Skip to content

Commit

Permalink
Change skip => disabled in jest addond
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jul 4, 2018
1 parent a10c19a commit 1e3d925
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
26 changes: 18 additions & 8 deletions addons/jest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,20 @@ storiesOf('MyComponent', module)
);
```

### Disabling

You can disable the addon for a single story by setting the `jest` parameter to `{disabled: true}`:

This comment has been minimized.

Copy link
@Keraito

Keraito Jul 4, 2018

Contributor

This should be disabled -> disable right @tmeasday? (Same for L132)

This comment has been minimized.

Copy link
@tmeasday

tmeasday Jul 5, 2018

Author Member

🙇 @Keraito


```js
storiesOf('MyComponent', module).add('Story', () => <div>Jest results disabled herek</div>, {
jest: disabled,
});
```

### withTests(options)

* **options.results**: OBJECT jest output results. _mandatory_
* **filesExt**: STRING test file extention. _optional_. This allow you to write "MyComponent" and not "MyComponent.test.js". It will be used as regex to find your file results. Default value is `((\\.specs?)|(\\.tests?))?(\\.js)?$`. That mean it will match: MyComponent.js, MyComponent.test.js, MyComponent.tests.js, MyComponent.spec.js, MyComponent.specs.js...
- **options.results**: OBJECT jest output results. _mandatory_
- **filesExt**: STRING test file extention. _optional_. This allow you to write "MyComponent" and not "MyComponent.test.js". It will be used as regex to find your file results. Default value is `((\\.specs?)|(\\.tests?))?(\\.js)?$`. That mean it will match: MyComponent.js, MyComponent.test.js, MyComponent.tests.js, MyComponent.spec.js, MyComponent.specs.js...

## Usage with Angular

Expand Down Expand Up @@ -174,12 +184,12 @@ storiesOf('MyComponent', module)

## TODO

* [ ] Add coverage
* [ ] Display nested test better (describe)
* [ ] Display the date of the test
* [ ] Add unit tests
* [ ] Add linting
* [ ] Split <TestPanel />
- [ ] Add coverage
- [ ] Display nested test better (describe)
- [ ] Display the date of the test
- [ ] Add unit tests
- [ ] Add linting
- [ ] Split <TestPanel />

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion addons/jest/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const withTests = userOptions => {
},
] = args;

if (testFiles && !testFiles.skip) {
if (testFiles && !testFiles.disable) {
emitAddTests({ kind, story, testFiles, options });
}

Expand Down

0 comments on commit 1e3d925

Please sign in to comment.