Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Commit

Permalink
Add initial scaffold test (#7)
Browse files Browse the repository at this point in the history
Add an initial integration test that will scaffold the app and run yarn targets from within that app.
  • Loading branch information
KevinGrandon authored Jun 12, 2018
1 parent 3de4d30 commit 040bcb4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
yarn-error.log
test-artifacts/
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
"prettier": "^1.13.5"
},
"scripts": {
"clean": "rm -rf test-artifacts",
"lint": "eslint .",
"test": "jest"
"test": "yarn clean && jest"
},
"jest": {
"cache": false,
Expand Down
22 changes: 21 additions & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
// @flow
/* eslint-env jest */

test('able to create an app', () => {});
const {promisify} = require('util');
const exec = promisify(require('child_process').exec);

function log(execOutput) {
// eslint-disable-next-line no-console
console.log(execOutput.stdout);
}

test(
'scaffolded app tests pass',
async () => {
await exec(`mkdir test-artifacts`);
log(
await exec(`node ../bin/cli.js test-scaffold`, {cwd: './test-artifacts'})
);

const options = {cwd: './test-artifacts/test-scaffold'};
log(await exec(`yarn build`, options));
},
300000
);

0 comments on commit 040bcb4

Please sign in to comment.