Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"strict": [
2,
"function"
],
"curly": 2,
"eqeqeq": 2,
"wrap-iife": [
2,
"any"
],
"no-use-before-define": [
2,
{
"functions": false
}
],
"new-cap": 2,
"no-caller": 2,
"dot-notation": 0,
"no-undef": 2,
"no-unused-vars": 2,
"no-cond-assign": [
2,
"except-parens"
],
"no-eq-null": 2
}
}
23 changes: 0 additions & 23 deletions .jshintrc

This file was deleted.

8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "4.1"
- "4.0"
- "0.12"
- "0.10"
- "4"
- "6"
- "7"
- "8"
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### 動作環境

* Node.js : 0.10.0以上
* Node.js : 4以上

### セットアップ

Expand All @@ -27,23 +27,27 @@ $ npm install
```sh
$ npm test

> [email protected] test /path/to/projects/javascript-mocha
> npm run lint && mocha --require intelli-espower-loader
> [email protected] pretest /path/to/projects/javascript-mocha
> npm run lint


> [email protected] lint /path/to/projects/javascript-mocha
> jshint lib test
> eslint 'lib/**' 'test/**'


> [email protected] test /path/to/projects/javascript-mocha
> mocha --require intelli-espower-loader



Sample
.status
✓ は、trueであるべき
#say()
✓ は、'Hello TDDBC!'が返ってくるべき
✓ は、"Hello TDDBC!"が返ってくるべき


2 passing (5ms)
2 passing (9ms)

$
```
Expand Down
4 changes: 1 addition & 3 deletions lib/sample.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
'use strict';

function Sample() {
this.status = true;
}

Sample.prototype.say = function () {
return "Hello TDDBC!";
return 'Hello TDDBC!';
};

module.exports = Sample;
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"url": "https://github.com/tddbc/javascript-mocha/issues"
},
"devDependencies": {
"espower-loader": "^1.0.0",
"eslint": "^4.1.1",
"espower-loader": "^1.2.2",
"intelli-espower-loader": "^1.0.1",
"jshint": "^2.9.1",
"mocha": "^2.4.5",
"mocha": "^3.4.2",
"power-assert": "^1.2.0"
},
"directories": {
Expand All @@ -25,18 +25,16 @@
"keywords": [
"TDDBC"
],
"license": {
"type": "MIT",
"url": "https://github.com/tddbc/javascript-mocha/blob/master/LICENSE-MIT"
},
"license": "MIT",
"main": "lib/sample.js",
"repository": {
"type": "git",
"url": "git://github.com/tddbc/javascript-mocha.git"
},
"scripts": {
"lint": "jshint lib test",
"test": "npm run lint && mocha --require intelli-espower-loader",
"lint": "eslint 'lib/**' 'test/**'",
"pretest": "npm run lint",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretest いいですね! 👍

"test": "mocha --require intelli-espower-loader",
"watch": "mocha --require intelli-espower-loader --watch"
}
}
6 changes: 2 additions & 4 deletions test/SampleTest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';

var assert = require('power-assert');
var assert = require('assert');

var Sample = require('../lib/sample');

Expand All @@ -18,7 +16,7 @@ describe('Sample', function () {
});

describe('#say()', function () {
it("は、'Hello TDDBC!'が返ってくるべき", function () {
it('は、"Hello TDDBC!"が返ってくるべき', function () {
assert(sut.say() === 'Hello TDDBC!');
});
});
Expand Down