-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(repo): update nx to 15.4.0-beta.3 (#13904)
- Loading branch information
1 parent
2614669
commit 5e5892f
Showing
5 changed files
with
277 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { | ||
cleanupProject, | ||
getSelectedPackageManager, | ||
newProject, | ||
runCLI, | ||
uniq, | ||
} from '@nrwl/e2e/utils'; | ||
import { checkApp } from './utils'; | ||
|
||
xdescribe('Next.js apps', () => { | ||
let originalEnv: string; | ||
|
||
beforeAll(() => { | ||
// TODO(jack): figure out why this does not work with pnpm | ||
const selectedPM = getSelectedPackageManager(); | ||
newProject({ | ||
packageManager: selectedPM === 'pnpm' ? 'yarn' : selectedPM, | ||
}); | ||
}); | ||
|
||
afterAll(() => cleanupProject()); | ||
|
||
beforeEach(() => { | ||
originalEnv = process.env.NODE_ENV; | ||
}); | ||
|
||
afterEach(() => { | ||
process.env.NODE_ENV = originalEnv; | ||
}); | ||
|
||
it('should support different --style options', async () => { | ||
const lessApp = uniq('app'); | ||
|
||
runCLI(`generate @nrwl/next:app ${lessApp} --no-interactive --style=less`); | ||
|
||
await checkApp(lessApp, { | ||
checkUnitTest: false, | ||
checkLint: false, | ||
checkE2E: false, | ||
checkExport: false, | ||
}); | ||
|
||
const stylusApp = uniq('app'); | ||
|
||
runCLI( | ||
`generate @nrwl/next:app ${stylusApp} --no-interactive --style=styl` | ||
); | ||
|
||
await checkApp(stylusApp, { | ||
checkUnitTest: false, | ||
checkLint: false, | ||
checkE2E: false, | ||
checkExport: false, | ||
}); | ||
|
||
const scApp = uniq('app'); | ||
|
||
runCLI( | ||
`generate @nrwl/next:app ${scApp} --no-interactive --style=styled-components` | ||
); | ||
|
||
await checkApp(scApp, { | ||
checkUnitTest: true, | ||
checkLint: false, | ||
checkE2E: false, | ||
checkExport: false, | ||
}); | ||
|
||
const emotionApp = uniq('app'); | ||
|
||
runCLI( | ||
`generate @nrwl/next:app ${emotionApp} --no-interactive --style=@emotion/styled` | ||
); | ||
|
||
await checkApp(emotionApp, { | ||
checkUnitTest: true, | ||
checkLint: false, | ||
checkE2E: false, | ||
checkExport: false, | ||
}); | ||
}, 300_000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { | ||
checkFilesExist, | ||
detectPackageManager, | ||
killPorts, | ||
readJson, | ||
runCLI, | ||
runCLIAsync, | ||
runCypressTests, | ||
tmpProjPath, | ||
} from '../../utils'; | ||
import { getLockFileName } from '../../../packages/nx/src/lock-file/lock-file'; | ||
|
||
export async function checkApp( | ||
appName: string, | ||
opts: { | ||
checkUnitTest: boolean; | ||
checkLint: boolean; | ||
checkE2E: boolean; | ||
checkExport: boolean; | ||
} | ||
) { | ||
const buildResult = runCLI(`build ${appName}`); | ||
expect(buildResult).toContain(`Compiled successfully`); | ||
checkFilesExist(`dist/apps/${appName}/.next/build-manifest.json`); | ||
|
||
const packageJson = readJson(`dist/apps/${appName}/package.json`); | ||
expect(packageJson.dependencies.react).toBeDefined(); | ||
expect(packageJson.dependencies['react-dom']).toBeDefined(); | ||
expect(packageJson.dependencies.next).toBeDefined(); | ||
|
||
checkFilesExist( | ||
`dist/apps/${appName}/${getLockFileName( | ||
detectPackageManager(tmpProjPath()) | ||
)}` | ||
); | ||
|
||
if (opts.checkLint) { | ||
const lintResults = runCLI(`lint ${appName}`); | ||
expect(lintResults).toContain('All files pass linting.'); | ||
} | ||
|
||
if (opts.checkUnitTest) { | ||
const testResults = await runCLIAsync(`test ${appName}`); | ||
expect(testResults.combinedOutput).toContain( | ||
'Test Suites: 1 passed, 1 total' | ||
); | ||
} | ||
|
||
if (opts.checkE2E && runCypressTests()) { | ||
const e2eResults = runCLI(`e2e ${appName}-e2e --no-watch`); | ||
expect(e2eResults).toContain('All specs passed!'); | ||
expect(await killPorts()).toBeTruthy(); | ||
} | ||
|
||
if (opts.checkExport) { | ||
runCLI(`export ${appName}`); | ||
checkFilesExist(`dist/apps/${appName}/exported/index.html`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
5e5892f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx.dev