Skip to content

Commit c8e4c13

Browse files
author
Kuniwak
committed
A name of the directory has stages should not "test", it is "public"
1 parent b8120d1 commit c8e4c13

30 files changed

+49
-21
lines changed

gulp/serve.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var stream = require('stream');
55
var gutil = require('gulp-util');
66

77
var SERVER_SCRIPT = './server.js';
8-
var PORT = 8000;
98

109

1110
var serve = function() {
@@ -18,7 +17,7 @@ var serve = function() {
1817
nodemon({
1918
script: SERVER_SCRIPT,
2019
watch: [SERVER_SCRIPT],
21-
env: { PORT: PORT },
20+
env: { PORT: serve.PORT },
2221
stdout: false
2322
})
2423
.on('readable', function() {
@@ -39,4 +38,7 @@ var serve = function() {
3938
return readable;
4039
};
4140

41+
42+
serve.PORT = 8000;
43+
4244
module.exports = serve;

gulpfile.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,46 @@
22

33
var util = require('util');
44
var gulp = require('gulp-help')(require('gulp'));
5+
var serve = require('./gulp/serve.js');
56

6-
var PORT = 8000;
7-
var BASE_URL = util.format('http://localhost:%d/', PORT);
7+
var BASE_URL = util.format('http://localhost:%d/', serve.PORT);
88

99
var tasks = [
1010
{
1111
cmd: 'stage1',
1212
help: '意図した DOM を取得できているかテストします',
1313
url: BASE_URL + 'stage1',
14-
src: 'test/stage1.js'
14+
src: 'public/stage1.js'
1515
}, {
1616
cmd: 'stage2',
17-
help: '意図通りに DOM の構造・スタイルが変更できているかテストします',
17+
help: '意図通りに DOM のスタイルが変更できているかテストします',
1818
url: BASE_URL + 'stage2',
19-
src: 'test/stage2.js'
19+
src: 'public/stage2.js'
2020
}, {
2121
cmd: 'stage3',
22-
help: '意図通りにイベントを利用できているかテストします',
22+
help: '意図通りに DOM の構造が変更できているかテストします',
2323
url: BASE_URL + 'stage3',
24-
src: 'test/stage3.js'
24+
src: 'public/stage3.js'
2525
}, {
2626
cmd: 'stage4',
27-
help: '意図通りにサーバーと通信できているかテストします',
27+
help: '意図通りにイベントを利用できているかテストします',
2828
url: BASE_URL + 'stage4',
29-
src: 'test/stage4.js'
29+
src: 'public/stage4.js'
3030
}, {
3131
cmd: 'stage5',
32-
help: '意図通りにモジュールを実装できているかテストします',
32+
help: '意図通りに非同期処理ができているかテストします',
3333
url: BASE_URL + 'stage5',
34-
src: 'test/stage5.js'
34+
src: 'public/stage5.js'
3535
}, {
3636
cmd: 'stage6',
37-
help: 'よくあるイディオムを読み書きできているかテストします',
37+
help: '意図通りにモジュールを実装できているかテストします',
3838
url: BASE_URL + 'stage6',
39-
src: 'test/stage6.js'
39+
src: 'public/stage6.js'
40+
}, {
41+
cmd: 'stage7',
42+
help: 'よくあるイディオムを読み書きできているかテストします',
43+
url: BASE_URL + 'stage7',
44+
src: 'public/stage7.js'
4045
}
4146
];
4247

@@ -47,7 +52,7 @@ tasks.forEach(function(task) {
4752
gulp.task(task.cmd, task.help, ['lint-' + task.cmd], function() {
4853
// We expected that mocha-phantomjs print colorized results, but it isn't.
4954
// So, I take a fast way that is using gulp-run.
50-
return run('`npm bin`/mocha-phantomjs ' + task.url + ' || true').exec();
55+
return run('$(npm bin)/mocha-phantomjs ' + task.url + ' || true').exec();
5156
});
5257
});
5358

@@ -64,6 +69,5 @@ tasks.forEach(function(task) {
6469

6570

6671
gulp.task('serve', 'サーバーを起動し、ブラウザでテストを確認できるようにします', function(){
67-
var serve = require('./gulp/serve.js');
6872
return serve();
6973
});
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)