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
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 committed Jun 11, 2018
1 parent 3de4d30 commit bc67bf7
Show file tree
Hide file tree
Showing 3 changed files with 25 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
23 changes: 22 additions & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
// @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));
log(await exec(`yarn test`, options));
},
300000
);

0 comments on commit bc67bf7

Please sign in to comment.