-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2018689
commit ce80105
Showing
4 changed files
with
63 additions
and
44 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,36 @@ | ||
import { | ||
uniq, | ||
runNxCommand, | ||
ensureNxProject, | ||
cleanup, | ||
readJson, | ||
updateFile, | ||
} from '@nx/plugin/testing'; | ||
|
||
const workerapp = uniq('workerapp'); | ||
|
||
describe('Next on Pages', () => { | ||
beforeEach(() => { | ||
ensureNxProject( | ||
'@naxodev/nx-cloudflare', | ||
'dist/packages/plugins/nx-cloudflare' | ||
); | ||
|
||
runNxCommand( | ||
`generate @nx/next:app --name ${workerapp} --directory="apps" --appDir` | ||
); | ||
}); | ||
|
||
afterEach(() => cleanup()); | ||
|
||
it('should build a NextJS application with the next-on-pages script', async () => { | ||
const projectJson = readJson(`apps/${workerapp}/project.json`); | ||
projectJson.targets.build.executor = '@naxodev/nx-cloudflare:next-build'; | ||
updateFile(`apps/${workerapp}/project.json`, JSON.stringify(projectJson)); | ||
|
||
const buildResults = runNxCommand(`build ${workerapp}`); | ||
expect(buildResults).toContain( | ||
`NX Successfully ran target build for project ${workerapp}` | ||
); | ||
}, 120_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
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