Files
next.js/test/e2e/app-dir/self-importing-package-monorepo/self-importing-package-monorepo.test.ts
2024-08-07 19:46:34 +02:00

30 lines
750 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('self-importing-package-monorepo', () => {
const dependencies = (global as any).isNextDeploy
? // `link` is incompatible with the npm version used when this test is deployed
{
'internal-pkg': 'file:./internal-pkg',
}
: {
'internal-pkg': 'link:./internal-pkg',
}
const { next } = nextTestSetup({
files: __dirname,
dependencies,
packageJson: {
name: 'next-app',
exports: {
'.': {
default: './index.js',
},
},
},
})
it('should resolve self-imports inside a monorepo', async () => {
const $ = await next.render$('/')
expect($('h1').text()).toBe('Hello world test abc index')
})
})