backbone-model-file-upload/Gruntfile.js

77 lines
1.6 KiB
JavaScript
Raw Normal View History

2017-08-29 20:58:52 +08:00
var webpackConfig = require('./webpack.config');
2014-12-17 15:33:48 +08:00
module.exports = function(grunt) {
grunt.initConfig({
run_node: {
start: {
files: { src: [ 'test/mock-file-server.js'] }
2014-12-17 15:33:48 +08:00
}
},
2017-08-29 20:58:52 +08:00
stop_node: {
stop: {}
},
2014-12-17 15:33:48 +08:00
2017-08-29 20:58:52 +08:00
jasmine: {
headless: {
options: {
browser: 'chrome',
headless: true,
timeout: 20000,
keepRunner: true,
outfile: '_SpecRunner.html',
host: 'http://localhost:8088',
summary: true,
display: 'short',
reportSlowerThan: 2000,
specs: [
'.grunt/tests.specs.js'
]
}
2014-12-17 15:33:48 +08:00
}
},
2017-08-29 20:58:52 +08:00
connect: {
test: {
options: {
2017-08-29 20:58:52 +08:00
port: 8088,
livereload: false,
hostname: '0.0.0.0', // to be able to access the server not only from localhost
base: {
path: '.'
}
}
},
2017-08-29 20:58:52 +08:00
specs: {
options: {
2017-08-29 20:58:52 +08:00
port: 8088,
livereload: false,
open: 'http://localhost:8088/_SpecRunner.html',
hostname: '0.0.0.0',
base: {
path: '.'
}
}
2014-12-17 15:33:48 +08:00
}
2017-08-29 20:58:52 +08:00
},
2017-08-29 20:58:52 +08:00
webpack: {
options: {
stats: false
},
test: webpackConfig
}
2014-12-17 15:33:48 +08:00
});
2017-08-29 20:58:52 +08:00
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-webpack');
2014-12-17 15:33:48 +08:00
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-run-node');
2017-08-29 20:58:52 +08:00
grunt.registerTask('test', ['webpack:test', 'connect:test', 'run_node','jasmine','stop_node']);
grunt.registerTask('test:browser', ['webpack:test', 'connect:specs', 'run_node','jasmine','stop_node']);
};