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

Add initial scaffold test #7

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);