Skip to content

Commit df5934d

Browse files
committed
Revert "Run CNA tests with Next.js from branch"
This reverts commit d648565.
1 parent d648565 commit df5934d

File tree

2 files changed

+8
-27
lines changed

2 files changed

+8
-27
lines changed

test/integration/create-next-app/package-manager/npm.test.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
import { trace } from 'next/dist/trace'
21
import {
32
DEFAULT_FILES,
43
FULL_EXAMPLE_PATH,
54
projectFilesShouldExist,
65
run,
76
useTempDir,
87
} from '../utils'
9-
import { createNextInstall } from '../../../lib/create-next-install'
108

119
const lockFile = 'package-lock.json'
1210
const files = [...DEFAULT_FILES, lockFile]
1311

14-
let nextInstall: Awaited<ReturnType<typeof createNextInstall>>
15-
beforeAll(async () => {
16-
nextInstall = await createNextInstall({
17-
parentSpan: trace('test'),
18-
keepRepoDir: Boolean(process.env.NEXT_TEST_SKIP_CLEANUP),
19-
})
20-
})
21-
2212
describe('create-next-app with package manager npm', () => {
2313
it('should use npm for --use-npm flag', async () => {
2414
await useTempDir(async (cwd) => {
@@ -34,7 +24,6 @@ describe('create-next-app with package manager npm', () => {
3424
'--no-tailwind',
3525
'--no-import-alias',
3626
],
37-
nextInstall.installDir,
3827
{
3928
cwd,
4029
}
@@ -63,7 +52,6 @@ it('should use npm when user-agent is npm', async () => {
6352
'--no-tailwind',
6453
'--no-import-alias',
6554
],
66-
nextInstall.installDir,
6755
{
6856
cwd,
6957
env: { npm_config_user_agent: 'npm' },
@@ -84,7 +72,6 @@ it('should use npm for --use-npm flag with example', async () => {
8472
const projectName = 'use-npm-with-example'
8573
const res = await run(
8674
[projectName, '--use-npm', '--example', FULL_EXAMPLE_PATH],
87-
nextInstall.installDir,
8875
{ cwd }
8976
)
9077

@@ -100,14 +87,10 @@ it('should use npm for --use-npm flag with example', async () => {
10087
it('should use npm when user-agent is npm with example', async () => {
10188
await useTempDir(async (cwd) => {
10289
const projectName = 'user-agent-npm-with-example'
103-
const res = await run(
104-
[projectName, '--example', FULL_EXAMPLE_PATH],
105-
nextInstall.installDir,
106-
{
107-
cwd,
108-
env: { npm_config_user_agent: 'npm' },
109-
}
110-
)
90+
const res = await run([projectName, '--example', FULL_EXAMPLE_PATH], {
91+
cwd,
92+
env: { npm_config_user_agent: 'npm' },
93+
})
11194

11295
expect(res.exitCode).toBe(0)
11396
projectFilesShouldExist({

test/integration/create-next-app/utils.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,25 @@ export const DEFAULT_FILES = [
1414
'node_modules/next',
1515
]
1616

17-
export const run = async (
17+
export const run = (
1818
args: string[],
19-
nextJSVersion: string,
2019
options:
2120
| execa.Options
2221
| {
2322
reject?: boolean
2423
env?: Record<string, string>
2524
}
26-
) => {
27-
return execa('node', [CNA_PATH].concat(args), {
25+
) =>
26+
execa('node', [CNA_PATH].concat(args), {
2827
// tests with options.reject false are expected to exit(1) so don't inherit
2928
stdio: options.reject === false ? 'pipe' : 'inherit',
3029
...options,
3130
env: {
3231
...process.env,
3332
...options.env,
34-
NEXT_PRIVATE_TEST_VERSION: nextJSVersion,
33+
NEXT_PRIVATE_TEST_VERSION: 'canary',
3534
},
3635
})
37-
}
3836

3937
export const command = (cmd: string, args: string[]) =>
4038
execa(cmd, args, {

0 commit comments

Comments
 (0)