Skip to content

Commit

Permalink
fix: test default extension
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Apr 4, 2021
1 parent a5bb101 commit 545dc11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/stories/src/tutorial/testing/jest-snapshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ quick start: the following command will generate a test file in `tests/stories.t
| `--generate`<br/>`-g` | generate test files for whole store or story/by story files | 'store' \| 'doc' \| 'story' | `store` |
| `--renderer`<br/>`-r` | jest framework renderer | 'rtl' \| 'rtr' \| 'enzyme' | `rtl` |
| `--output`<br/>`-o` | generated tests output folder | string | `tests` |
| `--test`<br/>`-t` | generated tests file name | string | `stories.test.js` |
| `--test`<br/>`-t` | generated tests file name | string | `component-controls.test.(js|ts)` |
| `--format`<br/>`-f` | generated test files format | 'cjs' \| 'esm' \| 'ts' | `cjs` |
| `--overwrite`<br/>`-w` | force ovewrite existing test files | boolean | `false` |
| `--bundle`<br/>`-b` | bundle path, if store loaded from bundle | string | |
Expand Down
4 changes: 3 additions & 1 deletion plugins/cc-cli/src/cli/cli-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export const cliStore = async (options: CliOptions): Promise<void> => {
format = 'cjs',
overwrite,
config,
test = 'stories.test.js',
test: userTest,
bundle,
name = 'component-controls generated',
output = 'tests',
} = options;
const test =
userTest || `component-controls.test.${format === 'ts' ? 'ts' : 'js'}`;
return await saveTemplate(
{
renderer,
Expand Down

0 comments on commit 545dc11

Please sign in to comment.