mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Writing to `join(next.testDir, '../package-lock.json')` breaks test isolation.
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { join } from 'path'
|
|
import { FileRef, nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('multiple-lockfiles - has-output-file-tracing-root', () => {
|
|
const { next, skipped } = nextTestSetup({
|
|
files: {
|
|
app: new FileRef(join(__dirname, 'app')),
|
|
// This will silence the multiple lockfiles warning.
|
|
'next.config.js': `module.exports = { outputFileTracingRoot: __dirname }`,
|
|
// Write a package-lock.json file to the parent directory to simulate
|
|
// multiple lockfiles.
|
|
'../package-lock.json': JSON.stringify({
|
|
name: 'parent-workspace',
|
|
version: '1.0.0',
|
|
lockfileVersion: 3,
|
|
}),
|
|
},
|
|
// So that ../package-lock.json doesn't leave the isolated testDir
|
|
subDir: 'test',
|
|
skipDeployment: true,
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
it('should not have multiple lockfiles warnings', async () => {
|
|
expect(next.cliOutput).not.toMatch(
|
|
/We detected multiple lockfiles and selected the directory of .+ as the root directory\./
|
|
)
|
|
})
|
|
})
|