Skip to content

Commit

Permalink
add grunt serve and run-tests tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
therewasaguy committed Jan 28, 2017
1 parent cb3ad5c commit 251ef4c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
58 changes: 31 additions & 27 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,10 @@ module.exports = function(grunt) {
// p5 dist
main: {
files: ['src/**/*.js'],
tasks: ['jshint', 'requirejs'],
tasks: ['requirejs'],
options: { livereload: true }
},
// reference
reference_build: {
files: ['docs/yuidoc-p5-theme/**/*'],
tasks: ['yuidoc'],
options: { livereload: true, interrupt: true }
},
// scripts for yuidoc/reference theme
yuidoc_theme_build: {
files: ['docs/yuidoc-p5-theme-src/scripts/**/*'],
tasks: ['requirejs:yuidoc_theme']
}
},
mocha: {
test: {
src: ['test/*.html'],
// src: ['test/**/*.html'],
options: {
// reporter: 'test/reporter/simple.js',
reporter: 'Nyan',
run: true,
log: true,
logErrors: true
}
},
},
requirejs: {
unmin: {
options: {
Expand Down Expand Up @@ -167,15 +143,43 @@ module.exports = function(grunt) {
}
}
},
},
open: {
testChrome: {
path: 'http://localhost:8000/test',
app: 'Chrome'
},
testFirefox : {
path: 'http://localhost:8000/test',
app: 'Firefox'
},
testSafari : {
path: 'http://localhost:8000/test',
app: 'Safari'
}
},
connect: {
server: {
options: {
port: 8000,
hostname: '*'
}
}
}
});


grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.registerTask('yui', ['yuidoc']);
// grunt.loadNpmTasks('grunt-mocha');

grunt.registerTask('default', ['requirejs']);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');

grunt.registerTask('default', ['requirejs']);
grunt.registerTask('dev', ['connect','requirejs', 'watch']);
grunt.registerTask('serve', 'connect:server:keepalive');
grunt.registerTask('run-tests', ['serve', 'open']);
};
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
"version": "0.3.2",
"license": "MIT",
"devDependencies": {
"almond": "~0.2.7",
"amdclean": "~2.0",
"grunt": "~0.4.2",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-mocha": "~0.4.6",
"phantomjs": "~1.9.2-4",
"grunt-lib-phantomjs": "~0.4.0",
"grunt-contrib-requirejs": "~0.4.1",
"grunt-contrib-sass": "~0.7.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-yuidoc": "0.5.2",
"almond": "~0.2.7",
"amdclean": "~2.0",
"grunt-contrib-sass": "~0.7.2"
"grunt-mocha": "~0.4.6",
"grunt-open": "^0.2.3",
"phantomjs": "~1.9.2-4"
},
"dependencies": {
"tone": "therewasaguy/tone.js#p5-dev"
Expand Down

0 comments on commit 251ef4c

Please sign in to comment.