This repository has been archived by the owner on May 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an initial integration test that will scaffold the app and run yarn targets from within that app.
- Loading branch information
1 parent
3de4d30
commit bc67bf7
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules/ | ||
yarn-error.log | ||
test-artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); |