Skip to content

Commit

Permalink
[fixed] only run tests after a successful build
Browse files Browse the repository at this point in the history
  • Loading branch information
thealjey committed Oct 7, 2015
1 parent 1ea9389 commit bc17907
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import {JS, NativeProcess, SASSLint} from 'webcompiler';
import {join} from 'path';

const rootDir = join(__dirname, '..'),
modulesDir = join(rootDir, 'node_modules'),
binDir = join(rootDir, 'bin'),
buildDir = join(rootDir, 'build'),
libDir = join(rootDir, 'lib'),
devDir = join(rootDir, 'development'),
docsDir = join(rootDir, 'docs'),
specDir = join(rootDir, 'spec'),
modulesDir = join(rootDir, 'node_modules'),
readme = join(rootDir, 'README.md'),
jsdocConfig = join(modulesDir, 'webcompiler', 'config', 'jsdoc.json'),
style = join(rootDir, '_index.scss'),
devStyle = join(devDir, 'app.scss'),
js = new JS(),
jsdoc = new NativeProcess(join(modulesDir, '.bin', 'jsdoc'));
jsdoc = new NativeProcess(join(modulesDir, '.bin', 'jsdoc')),
npm = new NativeProcess('npm');

new SASSLint().run([style, devStyle], function () {
js.beDir(libDir, buildDir, function () {
Expand All @@ -25,6 +26,7 @@ new SASSLint().run([style, devStyle], function () {
return console.error(e);
}
console.log('\x1b[32mGenerated API documentation!\x1b[0m');
npm.run(Function.prototype, ['test'], {stdio: 'inherit'});
}, [buildDir, '-d', docsDir, '-R', readme, '-c', jsdocConfig]);
}, specDir, binDir, devDir);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "build/index.js",
"scripts": {
"test": "babel-istanbul cover --root lib --print detail --include-all-sources --include-babel-polyfill jasmine",
"build": "npm test && babel-node bin/build",
"build": "babel-node bin/build",
"start": "babel-node bin/server"
},
"repository": {
Expand Down

0 comments on commit bc17907

Please sign in to comment.