commit
2e819f29de
@ -4,7 +4,7 @@
|
||||
"eqeqeq": true,
|
||||
"eqnull": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"latedef": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"node": true,
|
||||
|
17
.travis.yml
17
.travis.yml
@ -1,6 +1,17 @@
|
||||
sudo: false
|
||||
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- '5'
|
||||
- '4'
|
||||
- '0.10'
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
- "4"
|
||||
- "5"
|
||||
- "iojs"
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
31
appveyor.yml
31
appveyor.yml
@ -1,28 +1,37 @@
|
||||
# AppVeyor file
|
||||
# http://www.appveyor.com/docs/appveyor-yml
|
||||
clone_depth: 10
|
||||
|
||||
version: "{build}"
|
||||
|
||||
clone_depth: 10
|
||||
|
||||
# What combinations to test
|
||||
environment:
|
||||
matrix:
|
||||
- nodejs_version: "5"
|
||||
- nodejs_version: "4"
|
||||
- nodejs_version: "0.10"
|
||||
platform: x86
|
||||
- nodejs_version: "0.12"
|
||||
platform: x86
|
||||
- nodejs_version: "4"
|
||||
platform: x64
|
||||
- nodejs_version: "4"
|
||||
platform: x86
|
||||
- nodejs_version: "5"
|
||||
platform: x86
|
||||
|
||||
install:
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
- ps: Install-Product node $env:nodejs_version $env:platform
|
||||
- npm install
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
# Output useful info for debugging
|
||||
- node --version && npm --version
|
||||
- npm test
|
||||
# We test multiple Windows shells because of prior stdout buffering issues
|
||||
# filed against Grunt. https://github.com/joyent/node/issues/3584
|
||||
- ps: "npm test # PowerShell" # Pass comment to PS for easier debugging
|
||||
- cmd: npm test
|
||||
|
||||
build: off
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
cache:
|
||||
- 'node_modules -> package.json' # local npm modules
|
||||
- node_modules -> package.json
|
||||
|
13
package.json
13
package.json
@ -25,13 +25,12 @@
|
||||
"sprintf-js": "~1.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-cli": "^0.1.13",
|
||||
"grunt-contrib-connect": "^0.11.2",
|
||||
"grunt-contrib-internal": "^0.4.5",
|
||||
"grunt-contrib-jshint": "^0.11.0",
|
||||
"grunt-contrib-nodeunit": "^0.4.1",
|
||||
"grunt-contrib-watch": "^0.6.1"
|
||||
"grunt": "^1.0.1",
|
||||
"grunt-contrib-connect": "^1.0.1",
|
||||
"grunt-contrib-internal": "^1.1.0",
|
||||
"grunt-contrib-jshint": "^1.0.0",
|
||||
"grunt-contrib-nodeunit": "^1.0.0",
|
||||
"grunt-contrib-watch": "^1.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"gruntplugin",
|
||||
|
@ -13,7 +13,7 @@ module.exports = function(grunt) {
|
||||
// node api
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
sprintf = require("sprintf-js").sprintf;
|
||||
sprintf = require('sprintf-js').sprintf;
|
||||
|
||||
// npm lib
|
||||
var phantomjs = require('grunt-lib-phantomjs').init(grunt),
|
||||
@ -45,8 +45,8 @@ module.exports = function(grunt) {
|
||||
}
|
||||
};
|
||||
|
||||
//With node.js on Windows: use symbols available in terminal default fonts
|
||||
//https://github.com/visionmedia/mocha/pull/641
|
||||
// With node.js on Windows: use symbols available in terminal default fonts
|
||||
// https://github.com/visionmedia/mocha/pull/641
|
||||
if (process && process.platform === 'win32') {
|
||||
symbols = {
|
||||
none: {
|
||||
@ -67,7 +67,7 @@ module.exports = function(grunt) {
|
||||
};
|
||||
}
|
||||
|
||||
grunt.registerMultiTask('jasmine', 'Run jasmine specs headlessly through PhantomJS.', function() {
|
||||
grunt.registerMultiTask('jasmine', 'Run Jasmine specs headlessly through PhantomJS.', function() {
|
||||
|
||||
// Merge task-specific options with these defaults.
|
||||
var options = this.options({
|
||||
@ -87,7 +87,7 @@ module.exports = function(grunt) {
|
||||
ignoreEmpty: grunt.option('force') === true,
|
||||
display: 'full',
|
||||
summary: false
|
||||
});
|
||||
});
|
||||
|
||||
if (grunt.option('debug')) {
|
||||
grunt.log.debug(options);
|
||||
@ -136,7 +136,7 @@ module.exports = function(grunt) {
|
||||
file = options.host + options.outfile;
|
||||
}
|
||||
|
||||
grunt.verbose.subhead('Testing jasmine specs via phantom').or.writeln('Testing jasmine specs via PhantomJS');
|
||||
grunt.verbose.subhead('Testing Jasmine specs via PhantomJS').or.writeln('Testing Jasmine specs via PhantomJS');
|
||||
grunt.log.writeln('');
|
||||
|
||||
phantomjs.spawn(file, {
|
||||
@ -378,14 +378,14 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
function logSummary(tests) {
|
||||
grunt.log.writeln('Summary (' + tests.length + ' tests failed)');
|
||||
_.forEach(tests, function(test) {
|
||||
grunt.log.writeln(chalk.red(symbols[options.display].error) + ' ' + test.suite + ' ' + test.name);
|
||||
_.forEach(test.errors, function(error) {
|
||||
grunt.log.writeln(indent(2) + chalk.red(error.message));
|
||||
logStack(error.stack, 2);
|
||||
});
|
||||
grunt.log.writeln('Summary (' + tests.length + ' tests failed)');
|
||||
_.forEach(tests, function(test) {
|
||||
grunt.log.writeln(chalk.red(symbols[options.display].error) + ' ' + test.suite + ' ' + test.name);
|
||||
_.forEach(test.errors, function(error) {
|
||||
grunt.log.writeln(indent(2) + chalk.red(error.message));
|
||||
logStack(error.stack, 2);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function logStack(stack, indentLevel) {
|
||||
|
@ -54,13 +54,13 @@ exports.init = function(grunt, phantomjs) {
|
||||
exports.copyTempFile(path.join(__dirname, '/../jasmine/reporters/PhantomReporter.js'), 'reporter.js');
|
||||
|
||||
[].concat(jasmineRequire.files.cssFiles, jasmineRequire.files.jsFiles).forEach(function(name) {
|
||||
var srcPath = path.join(jasmineRequire.files.path, name);
|
||||
exports.copyTempFile(srcPath, name);
|
||||
var srcPath = path.join(jasmineRequire.files.path, name);
|
||||
exports.copyTempFile(srcPath, name);
|
||||
});
|
||||
|
||||
jasmineRequire.files.bootFiles.forEach(function(name) {
|
||||
var srcPath = path.join(jasmineRequire.files.bootDir, name);
|
||||
exports.copyTempFile(srcPath, name);
|
||||
var srcPath = path.join(jasmineRequire.files.bootDir, name);
|
||||
exports.copyTempFile(srcPath, name);
|
||||
});
|
||||
|
||||
exports.copyTempFile(path.join(jasmineRequire.files.imagesDir, 'jasmine_favicon.png'), 'jasmine_favicon.png');
|
||||
|
@ -2,13 +2,14 @@
|
||||
|
||||
var grunt = require('grunt'),
|
||||
phantomjs = require('grunt-lib-phantomjs').init(grunt),
|
||||
jasmine = require('../tasks/lib/jasmine.js').init(grunt, phantomjs);
|
||||
jasmine = require('../tasks/lib/jasmine.js').init(grunt, phantomjs),
|
||||
_ = require('lodash');
|
||||
|
||||
// Majority of test benefit comes from running the task itself.
|
||||
|
||||
function runTemplate(src, context) {
|
||||
var source = grunt.file.read(src);
|
||||
return grunt.util._.template(source, context);
|
||||
return _.template(source, context);
|
||||
}
|
||||
|
||||
// Just strips whitespace for now. Should do a proper min of everything
|
||||
|
Loading…
Reference in New Issue
Block a user