From 62b5d5f99dd0c0ff4c0a521c0b1017fa08d29de6 Mon Sep 17 00:00:00 2001 From: zholobovan Date: Mon, 3 Feb 2020 15:49:02 +0300 Subject: [PATCH 1/7] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..975c52d4 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,21 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '10.x' + displayName: 'Install Node.js' + +- script: | + npm install + npm run build + displayName: 'npm install and build' From 83dcf82738731e2d05a895bbd60e5e72faba7d3d Mon Sep 17 00:00:00 2001 From: Alexey Zholobov Date: Mon, 3 Feb 2020 19:29:46 +0300 Subject: [PATCH 2/7] test commit --- .gitignore | 2 ++ package.json | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b413127e..549d8056 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ node_modules /package-lock.json TEST-RESULTS.xml + +.nyc_output diff --git a/package.json b/package.json index 8685003a..d1358721 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "devDependencies": { "gulp": "^3.9.0", "gulp-mocha": "^2.2.0", - "mocha-junit-reporter": "^1.12.0", - "gulp-istanbul": "^1.1.3", - "nyc": "^12.0.2" + "mocha-junit-reporter": "^1.12.0", + "gulp-istanbul": "^1.1.3", + "nyc": "^12.0.2" }, "scripts": { "build": "nyc --reporter=cobertura --reporter=html ./node_modules/.bin/mocha tests/**/*.js --reporter mocha-junit-reporter --reporter-options mochaFile=./TEST-RESULTS.xml" From 10f32f2f3bebd39899e1fb014ebd932a5e600742 Mon Sep 17 00:00:00 2001 From: Alexey Zholobov Date: Mon, 3 Feb 2020 20:07:06 +0300 Subject: [PATCH 3/7] fail test --- tests/test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test.js b/tests/test.js index 48e8d410..91bd03cd 100644 --- a/tests/test.js +++ b/tests/test.js @@ -7,6 +7,7 @@ describe('String', function () { assert.equal(-1, myString.indexOf('x')); assert.equal(-1, myString.indexOf('y')); + assert.equal(-1, 1); }); }); }); From b30b0fee0291dd656b7a0a06b7e9a7acc4b4b826 Mon Sep 17 00:00:00 2001 From: zholobovan Date: Mon, 3 Feb 2020 23:40:23 +0300 Subject: [PATCH 4/7] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 975c52d4..0d9c63b7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,3 +19,8 @@ steps: npm install npm run build displayName: 'npm install and build' + +- script: | + uname -a + echo hello world + displayName: 'test script' \ No newline at end of file From c0cc85bdc4b24a3d60f99f47986304ba194ad162 Mon Sep 17 00:00:00 2001 From: Alexey Zholobov Date: Mon, 3 Feb 2020 23:41:48 +0300 Subject: [PATCH 5/7] fix tests --- tests/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.js b/tests/test.js index 91bd03cd..5188fe87 100644 --- a/tests/test.js +++ b/tests/test.js @@ -7,7 +7,7 @@ describe('String', function () { assert.equal(-1, myString.indexOf('x')); assert.equal(-1, myString.indexOf('y')); - assert.equal(-1, 1); + assert.equal(-1, -1); }); }); }); From 3a9f446ec054538eba2b376b449390fcab42d8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=96=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B1=D0=BE=D0=B2?= Date: Tue, 4 Feb 2020 14:33:13 +0300 Subject: [PATCH 6/7] add test publishing --- azure-pipelines.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0d9c63b7..f11ce77f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,14 @@ steps: npm run build displayName: 'npm install and build' +- task: PublishTestResults@2 + condition: succeededOrFailed() + inputs: + testRunner: JUnit + testResultsFiles: '**/TEST-RESULTS.xml' + - script: | uname -a echo hello world - displayName: 'test script' \ No newline at end of file + displayName: 'test script' + From 170234f1208718f1090f4816a7651fda66c316ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=96=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B1=D0=BE=D0=B2?= Date: Tue, 4 Feb 2020 15:13:13 +0300 Subject: [PATCH 7/7] add fail test --- tests/test-fail.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/test-fail.js diff --git a/tests/test-fail.js b/tests/test-fail.js new file mode 100644 index 00000000..b7069286 --- /dev/null +++ b/tests/test-fail.js @@ -0,0 +1,12 @@ +var assert = require('assert'); + +describe('String', function () { + describe('#indexOf', function () { + it('should return -1 when the substring is not present', function () { + var myString = 'test'; + + assert.equal(-1, myString.indexOf('x')); + assert.equal(-1, myString.indexOf('e')); + }); + }); +});