Skip to content

updated package name for svelte #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 9, 2019
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
26 changes: 23 additions & 3 deletions docs/svelte-testing-library/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Svelte Testing Library
[Svelte](https://svelte.dev/) components & applications.

```
npm install --save-dev svlt-testing-library
npm install --save-dev svelte-testing-library
```

- [svelte-testing-library on GitHub][gh]
Expand All @@ -21,7 +21,7 @@ order to use svelte in jest.
You must add `cleanup` to your test fixture's `beforeEach` hook:

```javascript
import { render, cleanup } from 'svlt-testing-library'
import { render, cleanup } from 'svelte-testing-library'

beforeEach(cleanup) //this is required.
```
Expand All @@ -48,7 +48,7 @@ App.spec.js

```javascript
import App from '../src/App.svelte'
import { render, cleanup } from 'svlt-testing-library'
import { render, cleanup } from 'svelte-testing-library'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there coordination between package authors for this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kentcdodds yep. Wendell had published an empty package with the name and didn't have time to implement it so he added me as a maintainer. It's all on Twitter. 🙂. https://twitter.com/benmonro/status/1124339261853954048?s=21

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most excellent!

beforeEach(cleanup)
describe('App', () => {
test('should render greeting', () => {
Expand All @@ -69,4 +69,24 @@ describe('App', () => {
})
```

### Cleanup

You can ensure [`cleanup`](./api#cleanup) is called after each test and import
additional assertions by adding it to the setup configuration in Jest.

In Jest 24 and up, add the
[`setupFilesAfterEnv`](https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array)
option to your Jest config:

```javascript
// jest.config.js
module.exports = {
setupFilesAfterEnv: [
'svelte-testing-library/cleanup-after-each',
// ... other setup files ...
],
// ... other options ...
}
```

[gh]: https://github.com/testing-library/svelte-testing-library
Binary file removed website/static/img/svelte-128x128.png
Binary file not shown.