Skip to content

Commit d61edbe

Browse files
committed
Tests for init task
1 parent 6e5cc50 commit d61edbe

28 files changed

+1169
-27
lines changed

grunt.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,18 @@ module.exports = function(grunt) {
6868
test: {
6969
// each task is tested individually, with basic files comparison with
7070
// what is in test/fixtures/
71-
// tasks: ['test/tasks/test-*.js']
71+
tasks: ['test/tasks/test-*.js'],
72+
73+
// default task with default options
74+
builds: ['test/tasks/default.js', 'test/tasks/usemin.js']
7275

7376
// css: 'test/tasks/test-css.js'
7477
// img: 'test/tasks/test-img.js'
7578
// tar: 'test/tasks/test-tar.js'
7679
// usemin: 'test/tasks/test-usemin.js'
7780
// docs: 'test/tasks/test-docs.js'
7881
// html: 'test/tasks/test-html.js'
79-
80-
// default task with default options
81-
basics: ['test/tasks/default.js', 'test/tasks/usemin.js']
82+
// init: 'test/tasks/test-init.js'
8283
}
8384
});
8485

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"html5-boilerplate": "./bin/h5bp",
99
"h5bp": "./bin/h5bp"
1010
},
11-
"main": "./lib/h5bp",
11+
"main": "./h5bp",
1212
"dependencies": {
1313
"rimraf": "~2.0.1",
1414
"mkdirp": "~0.3.1",
@@ -31,6 +31,6 @@
3131
},
3232
"scripts": {
3333
"pretest": "git submodule update --init",
34-
"test": "node node_modules/mocha/bin/mocha test/tasks/test-*.js --silent"
34+
"test": "node node_modules/mocha/bin/mocha test/tasks/*.js --silent"
3535
}
3636
}

tasks/init/h5bp/gruntfile.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ module.exports = function(grunt) {
108108
grunt.renameTask('min', '_min').registerTask('min', 'rjs');
109109
{% } %}
110110

111-
{% if (plugin) { %}
112-
grunt.loadNpmTasks('{%= plugin %}');
113-
{% } %}
111+
// uncomment this line if you're using the build script as a grunt plugin
112+
// it should be installed locally, even better if put in your package.json's
113+
// dependency
114+
//
115+
// grunt.loadNpmTasks('node-build-script');
114116
};

test/features/init.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: INIT task
2+
As a build script user
3+
I want to be able to run the init task
4+
So that I can see the init task in action
5+
6+
Scenario: init task
7+
Given I run the "init" task
8+
When the script ends
9+
Then ".test/init" should be the same as "test/fixtures/init/expected/"
10+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Numerous always-ignore extensions
2+
*.diff
3+
*.err
4+
*.orig
5+
*.log
6+
*.rej
7+
*.swo
8+
*.swp
9+
*.vi
10+
*~
11+
*.sass-cache
12+
13+
# OS or Editor folders
14+
.DS_Store
15+
._*
16+
Thumbs.db
17+
.cache
18+
.project
19+
.settings
20+
.tmproj
21+
nbproject
22+
*.sublime-project
23+
*.sublime-workspace
24+
25+
# Dreamweaver added files
26+
_notes
27+
dwsync.xml
28+
29+
# Komodo
30+
*.komodoproject
31+
.komodotools
32+
33+
# Espresso
34+
*.esproj
35+
*.espressostorage
36+
37+
# Rubinius
38+
*.rbc
39+
40+
# Folders to ignore
41+
.hg
42+
.svn
43+
.CVS
44+
intermediate
45+
publish
46+
.idea
47+
48+
# build script local files
49+
build/buildinfo.properties
50+
build/config/buildinfo.properties

0 commit comments

Comments
 (0)