feat(travis-tests): dont stop on first failure on master

This commit is contained in:
Julien Fontanet 2020-09-10 16:42:41 +02:00
parent 14c3fa4378
commit 12c774a34a
2 changed files with 15 additions and 14 deletions

View File

@ -73,11 +73,11 @@
"dev-test": "jest --bail --watch \"^(?!.*\\.integ\\.spec\\.js$)\"",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"posttest": "scripts/run-script test",
"pretest": "eslint --ignore-path .gitignore .",
"prettify": "prettier --ignore-path .gitignore --write '**/*.{js,jsx,md,mjs,ts,tsx}'",
"test": "jest \"^(?!.*\\.integ\\.spec\\.js$)\"",
"test": "npm run test-lint && npm run test-unit",
"test-integration": "jest \".integ\\.spec\\.js$\"",
"test-lint": "eslint --ignore-path .gitignore .",
"test-unit": "jest \"^(?!.*\\.integ\\.spec\\.js$)\" && scripts/run-script test",
"travis-tests": "scripts/travis-tests"
},
"workspaces": [

View File

@ -2,12 +2,8 @@
const { execFileSync, spawnSync } = require('child_process')
const run = (command, args) => {
const { status } = spawnSync(command, args, { stdio: 'inherit' })
if (status !== 0) {
process.exit(status)
}
}
const run = (command, args) =>
spawnSync(command, args, { stdio: 'inherit' }).status
const getFiles = () =>
execFileSync(
@ -30,12 +26,17 @@ const getFiles = () =>
if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
const files = getFiles().filter(_ => _.endsWith('.js'))
if (files.length !== 0) {
process.exit(
run(
'./node_modules/.bin/jest',
['--findRelatedTests', '--passWithNoTests'].concat(files)
)
)
}
} else {
run('yarn', ['test'])
process.exit(
run('yarn', ['test-lint']) +
run('yarn', ['test-unit']) +
run('yarn', ['test-integration'])
)
}