Skip to content

Commit 298b809

Browse files
Merge pull request #4 from twada/npm-run
npm run だけで動くようにする
2 parents 91c13d4 + 7ea8460 commit 298b809

File tree

9 files changed

+78
-114
lines changed

9 files changed

+78
-114
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
npm-debug.log
2+
node_modules

.jshintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"strict": true,
23
"curly": true,
34
"eqeqeq": true,
45
"immed": true,
@@ -10,5 +11,13 @@
1011
"unused": true,
1112
"boss": true,
1213
"eqnull": true,
13-
"node": true
14+
"node": true,
15+
"globals": {
16+
"describe": false,
17+
"it": false,
18+
"before": false,
19+
"after": false,
20+
"beforeEach": false,
21+
"afterEach": false
22+
}
1423
}

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
language: node_js
22
node_js:
33
- '0.10'
4-
before_script:
5-
- npm install -g grunt-cli

Gruntfile.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
$ git clone https://github.com/tddbc/javascript-mocha.git
1717
```
1818

19-
* 次に、[Grunt](http://gruntjs.com/)をインストールしてください。
20-
21-
```sh
22-
$ npm install -g grunt-cli
23-
```
24-
2519
* 次に、依存関係をダウンロードしてください。
2620

2721
```sh
@@ -31,23 +25,37 @@ $ npm install
3125
* 最後に、下記の様に表示されるか、確認してください。
3226

3327
```sh
34-
$ grunt test
35-
Running "mochacli:all" (mochacli) task
28+
$ npm test
29+
30+
> [email protected] test /path/to/projects/javascript-mocha
31+
> npm run lint && mocha --require intelli-espower-loader
32+
33+
34+
> [email protected] lint /path/to/projects/javascript-mocha
35+
> jshint lib test
36+
3637

3738

3839
Sample
3940
.status
40-
✓ は、trueであるべき
41+
✓ は、trueであるべき
4142
#say()
42-
✓ は、'Hello TDDBC!'が返ってくるべき
43-
43+
✓ は、'Hello TDDBC!'が返ってくるべき
4444

45-
2 passing (8ms)
4645

46+
2 passing (5ms)
4747

48-
Done, without errors.
48+
$
4949
```
5050

51+
### コマンド
52+
53+
| コマンド | 内容 |
54+
|:----------------|:-----------------------------------------------------------|
55+
| `npm test` | lint とテストをまとめて行います |
56+
| `npm run lint` | コードの静的検証を行います |
57+
| `npm run watch` | ファイル変更を監視し、変更があったらテストを自動で行います |
58+
5159
## License
5260
Copyright (c) 2013 TDD BaseCamp and other contributors
5361

espower_loader_helper.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/sample.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
function Sample() {
24
this.status = true;
35
}

package.json

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
{
2-
"name": "javascript-mocha",
3-
"description": "skeleton for Node.js users.",
4-
"version": "0.1.0",
5-
"homepage": "https://github.com/tddbc/javascript-mocha",
6-
"author": {
7-
"name": "TDD BaseCamp and other contributors"
8-
},
9-
"repository": {
10-
"type": "git",
11-
"url": "git://github.com/tddbc/javascript-mocha.git"
12-
},
13-
"bugs": {
14-
"url": "https://github.com/tddbc/javascript-mocha/issues"
15-
},
16-
"licenses": [
17-
{
18-
"type": "MIT",
19-
"url": "https://github.com/tddbc/javascript-mocha/blob/master/LICENSE-MIT"
20-
}
21-
],
22-
"main": "lib/sample.js",
23-
"engines": {
24-
"node": ">= 0.10.0"
25-
},
26-
"scripts": {
27-
"test": "grunt test"
28-
},
29-
"devDependencies": {
30-
"grunt": "~0.4.2",
31-
"grunt-contrib-jshint": "~0.10.0",
32-
"grunt-contrib-watch": "~0.6.1",
33-
"grunt-contrib-clean": "~0.5.0",
34-
"grunt-mocha-cli": "~1.8.0",
35-
"power-assert": "~0.7.2",
36-
"espower-loader": "~0.7.0"
37-
},
38-
"keywords": [
39-
"TDDBC"
40-
]
2+
"name": "javascript-mocha",
3+
"description": "skeleton for Node.js users.",
4+
"version": "0.1.0",
5+
"author": {
6+
"name": "TDD BaseCamp and other contributors"
7+
},
8+
"bugs": {
9+
"url": "https://github.com/tddbc/javascript-mocha/issues"
10+
},
11+
"devDependencies": {
12+
"espower-loader": "^0.10.0",
13+
"intelli-espower-loader": "^0.5.0",
14+
"jshint": "^2.5.10",
15+
"mocha": "^2.0.1",
16+
"power-assert": "^0.10.0"
17+
},
18+
"directories": {
19+
"test": "test"
20+
},
21+
"engines": {
22+
"node": ">= 0.10.0"
23+
},
24+
"homepage": "https://github.com/tddbc/javascript-mocha",
25+
"keywords": [
26+
"TDDBC"
27+
],
28+
"license": {
29+
"type": "MIT",
30+
"url": "https://github.com/tddbc/javascript-mocha/blob/master/LICENSE-MIT"
31+
},
32+
"main": "lib/sample.js",
33+
"repository": {
34+
"type": "git",
35+
"url": "git://github.com/tddbc/javascript-mocha.git"
36+
},
37+
"scripts": {
38+
"lint": "jshint lib test",
39+
"test": "npm run lint && mocha --require intelli-espower-loader",
40+
"watch": "mocha --require intelli-espower-loader --watch"
41+
}
4142
}

test/SampleTest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
'use strict';
2+
13
var assert = require('power-assert');
24

3-
var Sample = require('../lib/sample.js');
5+
var Sample = require('../lib/sample');
46

57
describe('Sample', function () {
68
var sut;

0 commit comments

Comments
 (0)