From e097338051cb41ab440d5096a711821677e9509c Mon Sep 17 00:00:00 2001 From: SkrzypMajster Date: Sat, 6 Apr 2019 10:25:48 +0200 Subject: [PATCH 1/5] Add travis.yml file for TravisCI --- travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 travis.yml diff --git a/travis.yml b/travis.yml new file mode 100644 index 0000000..6449588 --- /dev/null +++ b/travis.yml @@ -0,0 +1,12 @@ +language: node_js +sudo: false +node_js: + - 10 + - 9 + - 8 + - 7 + - 6 +install: + - npm install +script: + - npm test \ No newline at end of file From b3def7655330680b9c9a1037fd2f3a526e604f8b Mon Sep 17 00:00:00 2001 From: SkrzypMajster Date: Sat, 6 Apr 2019 10:30:52 +0200 Subject: [PATCH 2/5] Fix TravisCI file name --- travis.yml => .travis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename travis.yml => .travis.yml (100%) diff --git a/travis.yml b/.travis.yml similarity index 100% rename from travis.yml rename to .travis.yml From efb7f4ff091f2d4a922b4b0e7126f199ecc7f5f9 Mon Sep 17 00:00:00 2001 From: SkrzypMajster Date: Sat, 6 Apr 2019 10:37:43 +0200 Subject: [PATCH 3/5] Add README.md file with TravisCI build status --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ae3339b --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Swagger Contracts Generator + +[![Build Status](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator.svg?branch=master)](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator) \ No newline at end of file From bf4408e6576034a671d0875626980f82e5f4b5b7 Mon Sep 17 00:00:00 2001 From: SkrzypMajster Date: Sat, 6 Apr 2019 11:20:13 +0200 Subject: [PATCH 4/5] Add test coverage information into README.md file --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae3339b..f59268d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Swagger Contracts Generator -[![Build Status](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator.svg?branch=master)](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator) \ No newline at end of file +[![Build Status](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator.svg?branch=master)](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator) + +[![Coverage Status](https://coveralls.io/repos/github/SkrzypMajster/swagger-contracts-generator/badge.svg?branch=master)](https://coveralls.io/github/SkrzypMajster/swagger-contracts-generator?branch=master) \ No newline at end of file From 908a7640fb26c68b1e2eec9cd049acd463a8854f Mon Sep 17 00:00:00 2001 From: SkrzypMajster Date: Sat, 6 Apr 2019 11:30:21 +0200 Subject: [PATCH 5/5] Install Mocha and write simple unit test --- README.md | 4 ++-- package.json | 5 ++++- test/test.js | 9 +++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test/test.js diff --git a/README.md b/README.md index f59268d..b5109d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Swagger Contracts Generator -[![Build Status](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator.svg?branch=master)](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator) +[![Build Status](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator.svg?branch=develop)](https://travis-ci.org/SkrzypMajster/swagger-contracts-generator) -[![Coverage Status](https://coveralls.io/repos/github/SkrzypMajster/swagger-contracts-generator/badge.svg?branch=master)](https://coveralls.io/github/SkrzypMajster/swagger-contracts-generator?branch=master) \ No newline at end of file +[![Coverage Status](https://coveralls.io/repos/github/SkrzypMajster/swagger-contracts-generator/badge.svg?branch=develop)](https://coveralls.io/github/SkrzypMajster/swagger-contracts-generator?branch=develop) \ No newline at end of file diff --git a/package.json b/package.json index 4739f8f..7303c11 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "mocha" }, "repository": { "type": "git", @@ -19,5 +19,8 @@ "homepage": "https://github.com/SkrzypMajster/swagger-contracts-generator#readme", "dependencies": { "swagger-ts-generator": "^1.1.56" + }, + "devDependencies": { + "mocha": "^6.0.2" } } diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..df4f92e --- /dev/null +++ b/test/test.js @@ -0,0 +1,9 @@ +var assert = require('assert'); + +describe('Array', function () { + describe('#indexOf()', function () { + it('should return -1 when the value is not present', function () { + assert.equal([1, 2, 3].indexOf(4), -1); + }); + }); +}); \ No newline at end of file