Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Commit edb03c8

Browse files
author
Marlow Payne
committed
Better grunt tasks to open examples and tests
1 parent 8eb15f7 commit edb03c8

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Gruntfile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module.exports = function(grunt) {
3636
'grunt-contrib-watch',
3737
'grunt-eslint',
3838
'grunt-mocha-phantomjs',
39+
'grunt-open',
3940
'grunt-sass',
4041
'grunt-sass-lint',
4142
'grunt-shell',
@@ -48,10 +49,11 @@ module.exports = function(grunt) {
4849
}
4950
});
5051

52+
grunt.registerTask('examples', ['build', 'connect:server', 'open:examples', 'watch']);
5153
grunt.registerTask('serve', ['build', 'connect:server', 'watch']);
5254
grunt.registerTask('build', ['sasslint', 'lint:prod', 'copy', 'uglify', 'version:all', 'sass', 'autoprefixer']);
5355
grunt.registerTask('release', ['test', 'shell:tagRelease']);
5456
grunt.registerTask('test', ['build', 'connect:test', 'mocha_phantomjs']);
55-
grunt.registerTask('test:browser', ['build', 'connect:test:keepalive']);
57+
grunt.registerTask('test:browser', ['build', 'open:tests', 'connect:test:keepalive']);
5658
grunt.registerTask('default', 'build');
5759
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A mobile-first accordion UI module for progressive disclosure on the web.
99

1010
## Demo
1111

12-
You can find a simple demo on [the Documentation page](http://mobify.github.io/bellows). More demos can be found inside the `examples` folder in the repo.
12+
You can find a simple demo on [the Documentation page](http://mobify.github.io/bellows). More demos can be found inside the `examples` folder in the repo. Run `grunt examples` to see them in Chrome (mobile device emulation is recommended).
1313

1414
## Requirements
1515

tasks/config/open.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = function(grunt) {
2+
return {
3+
examples: {
4+
path: 'http://localhost:3000/examples',
5+
app: 'Google Chrome'
6+
},
7+
tests: {
8+
path: 'http://localhost:8888/tests/runner',
9+
app: 'Google Chrome'
10+
}
11+
};
12+
};

tasks/config/watch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = function(grunt) {
22
return {
3-
files: ["src/**/*"],
3+
files: [
4+
'src/**/*',
5+
'examples/**/*'
6+
],
47
tasks: ['build']
58
};
69
};

0 commit comments

Comments
 (0)