Skip to content

Commit

Permalink
Add integration test to cover vercel#7894
Browse files Browse the repository at this point in the history
  • Loading branch information
ctavan committed Oct 28, 2019
1 parent b45c011 commit 684c8ff
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import 'firebase/firestore'
export default () => <div>Firebase</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import 'firebase/firestore'
export default () => <div>Firebase</div>
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)
})
})

0 comments on commit 684c8ff

Please sign in to comment.