Skip to content

Commit

Permalink
Add script to install test deps
Browse files Browse the repository at this point in the history
  • Loading branch information
RaeesBhatti committed Jun 10, 2020
1 parent 7173f6d commit 5c19a7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"test": "run-s test:*",
"ava": "ava --verbose",
"format": "prettier --write \"{src,scripts,docs,site/src,.circleci,.github}/**/*.{js,md,yml,json,html}\" \"site/*.{js,md}\" \"*.{js,md,yml,json,html}\" \"tests/**/*.js\" \"!CHANGELOG.md\"",
"test:install-deps": "npm --prefix tests/site-cra",
"test:ava": "nyc --reporter=lcov ava --verbose && nyc report",
"test:lint": "eslint --fix \"{src,scripts}/**/*.js\"",
"test:format": "prettier --check \"{src,scripts,docs,site/src,.circleci,.github}/**/*.{js,md,yml,json,html}\" \"site/*.{js,md}\" \"*.{js,md,yml,json,html}\" \"tests/**/*.js\" \"!CHANGELOG.md\"",
Expand Down
16 changes: 0 additions & 16 deletions tests/cra.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@ const port = randomPort()
const host = 'localhost:' + port

test.before(async t => {
console.log('Installing Create React App project dependencies')
const { stdout, stderr, status, error } = spawnSync('npm', ['ci', '--prefix', 'tests/site-cra'], { shell: true })
if (status !== 0) {
const message = `Failed installing Create React App project dependencies from path '${sitePath}'`
console.error(message)
if (error) {
console.log('error:', error.message)
}
if (stdout) {
console.log('stdout:', stdout.toString())
}
if (stderr) {
console.log('stderr:', stderr.toString())
}
throw new Error(message)
}
console.log('Running Netlify Dev server in Create React App project')
ps = await spawn(cliPath, ['dev', '-p', port], {
cwd: sitePath,
Expand Down

0 comments on commit 5c19a7b

Please sign in to comment.