Skip to content

Commit 54ab68e

Browse files
committed
Created smoke test for the build process.
This smoke test will verify there's no errors being generated when running the build process. + minor package.json test script refactoring for increased readability
1 parent 0dbd6dc commit 54ab68e

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"serve": "node server.js",
99
"load-versions": "node scripts/load-versions.js",
1010
"start": "npm run serve",
11-
"test": "standard *.js scripts/*.js scripts/**/*.js tests/**/*.js && tape tests/**/*.test.js | faucet"
11+
"test": "npm run test:lint && npm run test:unit && npm run test:smoke",
12+
"test:lint": "standard *.js scripts/*.js scripts/**/*.js tests/*.js tests/**/*.js",
13+
"test:unit": "tape tests/**/*.test.js | faucet",
14+
"test:smoke": "tape tests/*.smoketest.js | faucet"
1215
},
1316
"repository": {
1417
"type": "git",

tests/build.smoketest.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict'
2+
3+
const path = require('path')
4+
const exec = require('child_process').exec
5+
const test = require('tape')
6+
7+
const pathToBuild = path.resolve(__dirname, '../build.js')
8+
9+
test('build.js', (t) => {
10+
t.plan(1)
11+
12+
t.test('should not generate error', (t) => {
13+
exec(`node ${pathToBuild}`, (err) => {
14+
t.equal(err, null)
15+
t.end()
16+
})
17+
})
18+
})

0 commit comments

Comments
 (0)