Unverified Commit 7c6e1e68 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Enable JS CNA tests for turbopack (#45323)

Enables the JS CNA template tests for turbopack as well now that we
landed `jsconfig` paths support.

x-ref: https://github.com/vercel/turbo/pull/3409
parent 806c9eeb
...@@ -35,7 +35,11 @@ const CHANGE_ITEM_GROUPS = { ...@@ -35,7 +35,11 @@ const CHANGE_ITEM_GROUPS = {
'packages/next-env/README.md', 'packages/next-env/README.md',
], ],
cna: ['packages/create-next-app'], cna: ['packages/create-next-app'],
'next-swc': ['packages/next-swc', 'scripts/normalize-version-bump.js'], 'next-swc': [
'packages/next-swc',
'scripts/normalize-version-bump.js',
'test/integration/create-next-app',
],
} }
async function main() { async function main() {
......
...@@ -32,7 +32,7 @@ const run = (args: string[], options: execa.Options) => { ...@@ -32,7 +32,7 @@ const run = (args: string[], options: execa.Options) => {
} }
describe('create next app', () => { describe('create next app', () => {
if (!process.env.NEXT_TEST_CNA) { if (!process.env.NEXT_TEST_CNA && process.env.NEXT_TEST_JOB) {
it('should skip when env is not set', () => {}) it('should skip when env is not set', () => {})
return return
} }
......
...@@ -51,7 +51,7 @@ const startsWithoutError = async ( ...@@ -51,7 +51,7 @@ const startsWithoutError = async (
let testVersion let testVersion
describe('create-next-app templates', () => { describe('create-next-app templates', () => {
if (!process.env.NEXT_TEST_CNA) { if (!process.env.NEXT_TEST_CNA && process.env.NEXT_TEST_JOB) {
it('should skip when env is not set', () => {}) it('should skip when env is not set', () => {})
return return
} }
...@@ -213,9 +213,10 @@ describe('create-next-app templates', () => { ...@@ -213,9 +213,10 @@ describe('create-next-app templates', () => {
expect(exitCode).toBe(0) expect(exitCode).toBe(0)
shouldBeJavascriptProject({ cwd, projectName, template: 'default' }) shouldBeJavascriptProject({ cwd, projectName, template: 'default' })
// TODO: enable turbo mode as well once jsconfig paths support await startsWithoutError(path.join(cwd, projectName), [
// is landed 'default',
await startsWithoutError(path.join(cwd, projectName), ['default']) 'turbo',
])
}) })
}) })
...@@ -245,15 +246,16 @@ describe('create-next-app templates', () => { ...@@ -245,15 +246,16 @@ describe('create-next-app templates', () => {
template: 'default', template: 'default',
srcDir: true, srcDir: true,
}) })
// TODO: enable turbo mode as well once jsconfig paths support await startsWithoutError(path.join(cwd, projectName), [
// is landed 'default',
await startsWithoutError(path.join(cwd, projectName), ['default']) 'turbo',
])
}) })
}) })
}) })
describe('create-next-app --experimental-app-dir', () => { describe('create-next-app --experimental-app-dir', () => {
if (!process.env.NEXT_TEST_CNA) { if (!process.env.NEXT_TEST_CNA && process.env.NEXT_TEST_JOB) {
it('should skip when env is not set', () => {}) it('should skip when env is not set', () => {})
return return
} }
...@@ -314,9 +316,11 @@ describe('create-next-app --experimental-app-dir', () => { ...@@ -314,9 +316,11 @@ describe('create-next-app --experimental-app-dir', () => {
const exitCode = await spawnExitPromise(childProcess) const exitCode = await spawnExitPromise(childProcess)
expect(exitCode).toBe(0) expect(exitCode).toBe(0)
shouldBeTemplateProject({ cwd, projectName, template: 'app', mode: 'js' }) shouldBeTemplateProject({ cwd, projectName, template: 'app', mode: 'js' })
// TODO: enable turbo mode as well once jsconfig paths support
// is landed // is landed
await startsWithoutError(path.join(cwd, projectName), ['default']) await startsWithoutError(path.join(cwd, projectName), [
'default',
'turbo',
])
}) })
}) })
...@@ -348,9 +352,10 @@ describe('create-next-app --experimental-app-dir', () => { ...@@ -348,9 +352,10 @@ describe('create-next-app --experimental-app-dir', () => {
mode: 'js', mode: 'js',
srcDir: true, srcDir: true,
}) })
// TODO: enable turbo mode as well once jsconfig paths support await startsWithoutError(path.join(cwd, projectName), [
// is landed 'default',
await startsWithoutError(path.join(cwd, projectName), ['default']) 'turbo',
])
}) })
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment