Skip to content

Commit

Permalink
fix(test): No longer default to watch mode outside of CI (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles committed Oct 19, 2018
1 parent d8b1cf4 commit 5882f4f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ The `sku test` command will invoke Jest, running any tests in files named `*.tes

Since sku uses Jest as a testing framework, you can read the [Jest documentation](https://facebook.github.io/jest/) for more information on writing compatible tests.

Note: `sku` will forward all command line args to `jest`.

Example running tests in watch mode:
```bash
$ sku test --watch
```

### Linting and Formatting (via [ESLint](http://eslint.org/) and [Prettier](https://github.com/prettier/prettier))

Running `sku lint` will execute the ESLint rules over the code in your `src` directory. You can see the ESLint rules defined for sku projects in [eslint-config-seek](https://github.com/seek-oss/eslint-config-seek).
Expand Down
4 changes: 0 additions & 4 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const jestConfig =
? builds[0].jestDecorator(baseJestConfig)
: baseJestConfig;

if (!process.env.CI && argv.indexOf('--coverage') < 0) {
argv.push('--watch');
}

argv.push('--config', JSON.stringify(jestConfig));

jest.run(argv);
2 changes: 1 addition & 1 deletion test/utils/runSkuScriptInDir.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = async (script, cwd) => {
return await exec(`${skuBin} ${script}`, {
stdio: 'inherit',
cwd,
env: { ...process.env, CI: 'true' }
env: process.env
});
} catch (error) {
// Print the stdout of a failed command so we can see it in the jest output.
Expand Down

0 comments on commit 5882f4f

Please sign in to comment.