Skip to content

Commit

Permalink
bugfix: [fixes #156] expose shouldScheduleUpdate function (#157)
Browse files Browse the repository at this point in the history
* chore: [#156] upgrade to jest@28
* feat: [#156] expose shouldScheduleUpdate function
* docs: add Jest troubleshooting info
  • Loading branch information
jeremyckahn authored Aug 7, 2022
1 parent e4d6b40 commit 61e5fcd
Show file tree
Hide file tree
Showing 8 changed files with 2,732 additions and 4,252 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,30 @@ Please see the [Getting
Started](https://jeremyckahn.github.io/shifty/doc/tutorial-getting-started.html)
guide and check out the API documentation.

### Troubleshooting

#### Jest

With later versions of Jest [it is
known](https://github.com/jeremyckahn/shifty/issues/156) that by default Shifty
may cause warnings that look like:

```
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
```

To prevent this, use
[`shouldScheduleUpdate`](https://jeremyckahn.github.io/shifty/doc/shifty.html#.shouldScheduleUpdate)
in your test setup like so:

```js
import { shouldScheduleUpdate } from 'shifty'

afterAll(() => {
shouldScheduleUpdate(false)
})
```

## Releasing

Releases are done from the CLI. Assuming you have commit access, use [`npm version`](https://docs.npmjs.com/cli/v8/commands/npm-version) to tag and push a
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ module.exports = {
// setupFiles: [],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
setupFilesAfterEnv: ['./setupTests.js'],

// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
Expand Down Expand Up @@ -182,4 +182,4 @@ module.exports = {

// Whether to use watchman for file crawling
// watchman: true,
};
}
Loading

0 comments on commit 61e5fcd

Please sign in to comment.