diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b4fdd3b9..e8b23d34 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ jobs: yarn displayName: 'Install dependencies and build' - script: | - yarn mocha + yarn test-unit displayName: 'Unit tests' - script: | yarn lint @@ -38,7 +38,7 @@ jobs: yarn displayName: 'Install dependencies and build' - script: | - yarn mocha + yarn test-unit displayName: 'Unit tests' - script: | yarn lint @@ -56,7 +56,7 @@ jobs: yarn displayName: 'Install dependencies and build' - script: | - yarn mocha + yarn test-unit displayName: 'Unit tests' - script: | yarn lint diff --git a/bin/test.js b/bin/test.js index 0f26965b..42e1a473 100644 --- a/bin/test.js +++ b/bin/test.js @@ -10,14 +10,13 @@ const path = require('path'); const env = { ...process.env }; env.NODE_PATH = path.resolve(__dirname, '../out'); -const testPaths = [ +const args = [ './out/*test.js', './out/**/*test.js', './out/*integration.js', './out/**/*integration.js', './lib/**/*test.js' ]; -const args = testPaths.map(p => `'${p}'`); cp.spawnSync(path.resolve(__dirname, '../node_modules/.bin/mocha'), args, { cwd: path.resolve(__dirname, '..'), diff --git a/package.json b/package.json index 869da573..18f8ef9f 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "start-debug": "node --inspect-brk demo/start", "start-zmodem": "node demo/zmodem/app", "lint": "tslint 'src/**/*.ts' './demo/**/*.ts'", - "test": "node ./bin/test.js", + "test-unit": "node ./bin/test.js", + "test": "npm run test-unit", "posttest": "npm run lint", "test-api": "mocha \"**/*.api.js\"", "build": "tsc -b ./src/tsconfig.all.json",