Skip to content

Commit

Permalink
build(Releasing): Add Travis CI, Conventional commit and semantic-rel…
Browse files Browse the repository at this point in the history
…eace-cli

closes #1
  • Loading branch information
gaithoben committed Dec 29, 2017
1 parent 1b790a1 commit ca1e9f4
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: node_js
cache:
directories:
- ~/.npm
notifications:
email: false
node_js:
- '9'
- '8'
- '6'
- '4'
script:
- npm run test
after_success:
- npm run semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/
242 changes: 241 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "kenya",
"version": "1.1.0",
"version": "0.0.0-development",
"description":
"A package with various components describing kenyan geography",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"commit": "git-cz",
"test": "mocha src/index.test.js -w",
"semantic-release": "semantic-release"
},
"repository": {
"type": "git",
"url": "git+https://github.com/gaithoben/kenya.git"
"url": "https://github.com/gaithoben/kenya.git"
},
"keywords": ["kenya", "counties", "constituencies", "wards"],
"author":
Expand All @@ -21,5 +23,13 @@
"homepage": "https://github.com/gaithoben/kenya#readme",
"dependencies": {
"unique-random-array": "1.0.0"
},
"devDependencies": {
"chai": "4.1.2",
"mocha": "4.0.1",
"semantic-release": "^11.0.2"
},
"czConfig": {
"path": "cz-conventional-changelog"
}
}
22 changes: 22 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var expect = require('chai').expect;

var kenya = require('./index');

describe('Counties List', function() {
describe('counties', function() {
it('Should be an array of objects', function() {
expect(kenya.counties).to.satisfy(arraOfObjects);

function arraOfObjects(args) {
return typeof args === 'object';
}
});
});

describe('Random county', function() {
it('Should return a random county from the list of all counties', function() {
var randomcounty = kenya.randomcounty();
expect(kenya.counties).to.include(randomcounty);
});
});
});

0 comments on commit ca1e9f4

Please sign in to comment.