Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ const { execSync } = require('child_process')
const rimraf = require('rimraf')
const { error } = require('./helpers/logger')

// TODO: Jest can't process coverage of spaned processes
// May need to wrap NYC to get the coverage of all the
// code executed here
// https://github.com/amclin/react-project-boilerplate/issues/28
// TODO: Once nyc major version 15 is released, update to that version and make any necessary code
// adjustments to accommodate breaking changes (if applicable). Current version of nyc
// relies on npm module spawn-wrap and has issues with edge cases when used in this particular
// manner - particularly on Windows runtimes: https://github.com/facebook/jest/issues/5274#issuecomment-554657586

// Discussion thread: https://github.com/amclin/react-project-boilerplate/issues/28
const WORKAROUND_PREPEND = 'nyc --reporter none';

describe('Integration Test', () => {
describe('Generated App', () => {
beforeAll( async () => {
// Run the generator expecting successful STDOUT
try {
await execSync('node ./index.js --use-npm --no-git --with-ssr -- tmp', { stdio: 'inherit' })
// Interim workaround: https://github.com/facebook/jest/issues/3190#issuecomment-354758036
await execSync(`${WORKAROUND_PREPEND} node ./index.js --use-npm --no-git --with-ssr -- tmp`, { stdio: 'inherit' })
} catch (e) {
error('Failed to complete generation process.', e)
expect(true).toEqual(false) // Force test failure
Expand Down
Loading