forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test to cover vercel#7894
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
test/integration/build-firebase-only-sequentially/pages/page-1.js
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,2 @@ | ||
import 'firebase/firestore' | ||
export default () => <div>Firebase</div> |
2 changes: 2 additions & 0 deletions
2
test/integration/build-firebase-only-sequentially/pages/page-2.js
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,2 @@ | ||
import 'firebase/firestore' | ||
export default () => <div>Firebase</div> |
37 changes: 37 additions & 0 deletions
37
test/integration/build-firebase-only-sequentially/test/index.test.js
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,37 @@ | ||
/* eslint-env jest */ | ||
/* global jasmine */ | ||
import path from 'path' | ||
import fs from 'fs-extra' | ||
import { nextBuild } from 'next-test-utils' | ||
|
||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1 | ||
const appDir = path.join(__dirname, '..') | ||
const nextConfig = path.join(appDir, 'next.config.js') | ||
|
||
describe('Builds with firebase dependency only sequentially', () => { | ||
it('Throws an error when building with firebase dependency in parallel', async () => { | ||
await fs.writeFile( | ||
nextConfig, | ||
`module.exports = { experimental: { cpus: 2 } }` | ||
) | ||
const results = await nextBuild(appDir, [], { stdout: true, stderr: true }) | ||
expect(results.stdout + results.stderr).toMatch(/Build error occurred/) | ||
expect(results.stdout + results.stderr).toMatch( | ||
/grpc_node\.node\. Module did not self-register\./ | ||
) | ||
await fs.remove(nextConfig) | ||
}) | ||
|
||
it('Throws no error when building with firebase dependency in sequence', async () => { | ||
await fs.writeFile( | ||
nextConfig, | ||
`module.exports = { experimental: { cpus: 1 } }` | ||
) | ||
const results = await nextBuild(appDir, [], { stdout: true, stderr: true }) | ||
expect(results.stdout + results.stderr).not.toMatch(/Build error occurred/) | ||
expect(results.stdout + results.stderr).not.toMatch( | ||
/grpc_node\.node\. Module did not self-register\./ | ||
) | ||
await fs.remove(nextConfig) | ||
}) | ||
}) |