mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
I've simplified @timneutkens's tests from #66486 The resolver fix is in https://github.com/vercel/turbo/pull/8820 Closes https://github.com/vercel/next.js/pull/66486 Related issue: https://github.com/vercel/next.js/issues/66487 --------- Co-authored-by: Tim Neutkens <[email protected]>
30 lines
750 B
TypeScript
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')
|
|
})
|
|
})
|