diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b1ccdbf0..a58f7fe0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ jobs: yarn displayName: 'Install dependencies and build' - script: | - yarn test-unit + yarn test-unit --forbid-only displayName: 'Unit tests' - script: | yarn lint @@ -38,7 +38,7 @@ jobs: yarn displayName: 'Install dependencies and build' - script: | - yarn test-unit + yarn test-unit --forbid-only displayName: 'Unit tests' - script: | yarn lint @@ -56,7 +56,7 @@ jobs: yarn displayName: 'Install dependencies and build' - script: | - yarn test-unit + yarn test-unit --forbid-only displayName: 'Unit tests' - script: | yarn lint @@ -80,7 +80,7 @@ jobs: - script: | yarn start & sleep 10 - yarn test-api --headless + yarn test-api --headless --forbid-only displayName: 'Linux Integration tests' - job: macOS_IntegrationTests @@ -97,7 +97,7 @@ jobs: - script: | yarn start & sleep 10 - yarn test-api --headless + yarn test-api --headless --forbid-only displayName: 'MacOS Integration tests' - job: Release diff --git a/bin/test.js b/bin/test.js index 775ec004..3b08d4a1 100644 --- a/bin/test.js +++ b/bin/test.js @@ -15,15 +15,22 @@ let testFiles = [ './out/**/*test.js' ]; -// ability to inject particular test files via -// yarn test [testFileA testFileB ...] +let flagArgs = []; + if (process.argv.length > 2) { - testFiles = process.argv.slice(2); + const args = process.argv.slice(2); + flagArgs = args.filter(e => e.startsWith('--')); + // ability to inject particular test files via + // yarn test [testFileA testFileB ...] + files = args.filter(e => !e.startsWith('--')); + if (files.length) { + testFiles = files; + } } const run = cp.spawnSync( path.resolve(__dirname, '../node_modules/.bin/mocha'), - testFiles, + [...testFiles, ...flagArgs], { cwd: path.resolve(__dirname, '..'), env, @@ -31,4 +38,4 @@ const run = cp.spawnSync( } ); -process.exit(run.status); \ No newline at end of file +process.exit(run.status);