Skip to content

Commit

Permalink
Minimal tests to ensure build passes
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Jan 7, 2014
1 parent fd78419 commit 43540fc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
@@ -0,0 +1,12 @@
language: node_js
node_js:
- "0.10"
before_script:
- npm install
notifications:
email:
recipients:
- jsbin@leftlogic.com
irc: "chat.freenode.net#jsbin"
on_success: change
on_failure: always
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -18,7 +18,7 @@
"url": "git://github.com/remy/jsbin.git"
},
"scripts": {
"test": "node_modules/mocha/bin/_mocha --ui bdd test/**/*.test.js",
"test": "node_modules/mocha/bin/_mocha -t 25000 --ui bdd test/**/*.test.js",
":install": "build/install.js",
"preupdate": "node build/pre-update.js",
"postupdate": "node build/post-update.js commit"
Expand Down Expand Up @@ -53,7 +53,8 @@
"grunt-contrib-uglify": "~0.2.2",
"should": "~1.2.2",
"mocha": "~1.11.0",
"sinon": "~1.7.3"
"sinon": "~1.7.3",
"grunt-cli": "~0.1.11"
},
"optionalDependencies": {},
"licenses": [
Expand Down
27 changes: 27 additions & 0 deletions test/gruntfile.test.js
@@ -0,0 +1,27 @@
'use strict';
/*global describe:true, it: true */
var assert = require('assert'),
grunt = require('grunt'),
pwd = process.cwd(),
path = require('path');


describe('Gruntfile', function () {
it('should exit cleanly', function (done) {
var gruntPath = path.resolve(pwd, 'node_modules/grunt-cli/bin/grunt');

console.log(path.resolve(pwd, 'Gruntfile.js'));

grunt.util.spawn({
cmd: 'node',
// grunt: true, // not running grunt in the first place
args: [gruntPath, '--gruntfile', path.resolve(pwd, 'Gruntfile.js'), 'build'],
}, function (error, result) {
console.log(result);
assert(result.code === 0, 'exit code: ' + result.code);
assert(result.stdout, 'there was some output');

done();
});
});
});

0 comments on commit 43540fc

Please sign in to comment.