Skip to content

Commit

Permalink
Modernize testing and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mridgway committed Apr 5, 2016
1 parent 0a4b455 commit c810905
Show file tree
Hide file tree
Showing 7 changed files with 604 additions and 624 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
artifacts
node_modules
**/artifacts
**/node_modules
9 changes: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
env:
node: true
extend: "eslint:recommended"
rules:
indent: [2, 4, {SwitchCase: 1}]
quotes: [2, 'single']
dot-notation: [2, {allowKeywords: false}]

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
artifacts
node_modules
results.xml
*.log
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
sudo: false
language: node_js
node_js:
- 0.10
- 0.11
- "0.10"
- "0.12"
- "4"
- "5"
notifications:
email:
recipients:
Expand Down
4 changes: 2 additions & 2 deletions examples/full/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var libfs = require('fs'),

/**
@param {string} file JSON valid file representing a configuration
@return {object} the parsed version of `file`
@return {object} the parsed version of `file`
**/
function readFile(file) {
var raw = libfs.readFileSync(libpath.join(__dirname, file));
Expand All @@ -43,7 +43,7 @@ assert.equal(8000, config.appPort);
// read "environment:development"
config = ycb.read({ environment: 'development' });
assert.equal(false, config.yui.config.combine);
assert.equal("debug", config.yui.config.logLevel);
assert.equal('debug', config.yui.config.logLevel);
assert.equal(false, config.yui.config.fetchCSS);

config = ycb.readNoMerge({ environment: 'development' }, {});
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
"dependencies": {},
"main": "index",
"scripts": {
"pretest": "jshint index.js tests/unit.js examples/*/*.js",
"test": "node tests/unit"
"cover": "istanbul cover --dir artifacts -- _mocha tests/unit --recursive--reporter spec",
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha tests/unit --reporter spec"
},
"engines": {
"node": ">0.4",
"npm": ">1.0"
},
"devDependencies": {
"yui": ">3.5",
"istanbul": ">=0.1.32",
"jshint": "2.5.5"
"eslint": "^2.2.0",
"istanbul": "^0.4.2",
"mocha": "^2.0.1"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit c810905

Please sign in to comment.