Skip to content

Commit bc17907

Browse files
committed
[fixed] only run tests after a successful build
1 parent 1ea9389 commit bc17907

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

bin/build.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ import {JS, NativeProcess, SASSLint} from 'webcompiler';
44
import {join} from 'path';
55

66
const rootDir = join(__dirname, '..'),
7-
modulesDir = join(rootDir, 'node_modules'),
87
binDir = join(rootDir, 'bin'),
98
buildDir = join(rootDir, 'build'),
109
libDir = join(rootDir, 'lib'),
1110
devDir = join(rootDir, 'development'),
1211
docsDir = join(rootDir, 'docs'),
1312
specDir = join(rootDir, 'spec'),
13+
modulesDir = join(rootDir, 'node_modules'),
1414
readme = join(rootDir, 'README.md'),
1515
jsdocConfig = join(modulesDir, 'webcompiler', 'config', 'jsdoc.json'),
1616
style = join(rootDir, '_index.scss'),
1717
devStyle = join(devDir, 'app.scss'),
1818
js = new JS(),
19-
jsdoc = new NativeProcess(join(modulesDir, '.bin', 'jsdoc'));
19+
jsdoc = new NativeProcess(join(modulesDir, '.bin', 'jsdoc')),
20+
npm = new NativeProcess('npm');
2021

2122
new SASSLint().run([style, devStyle], function () {
2223
js.beDir(libDir, buildDir, function () {
@@ -25,6 +26,7 @@ new SASSLint().run([style, devStyle], function () {
2526
return console.error(e);
2627
}
2728
console.log('\x1b[32mGenerated API documentation!\x1b[0m');
29+
npm.run(Function.prototype, ['test'], {stdio: 'inherit'});
2830
}, [buildDir, '-d', docsDir, '-R', readme, '-c', jsdocConfig]);
2931
}, specDir, binDir, devDir);
3032
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "build/index.js",
66
"scripts": {
77
"test": "babel-istanbul cover --root lib --print detail --include-all-sources --include-babel-polyfill jasmine",
8-
"build": "npm test && babel-node bin/build",
8+
"build": "babel-node bin/build",
99
"start": "babel-node bin/server"
1010
},
1111
"repository": {

0 commit comments

Comments
 (0)