Skip to content

Commit

Permalink
Add new way to import files.
Browse files Browse the repository at this point in the history
  • Loading branch information
janhesters committed May 18, 2019
1 parent 9b8f2ae commit 49686ca
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ yarn add --dev riteway-jest
Then import it in your `src/setupTests.js` for React with CRA.

```js
import 'riteway-jest';
import 'riteway-jest/assert';
```

And for React Native you need to add it to your `jest.config.js`.

```js
module.exports = {
setupFilesAfterEnv: [
'riteway-jest',
'riteway-jest/assert',
// ... other setup files ...
],
// ... other options ...
Expand Down
1 change: 1 addition & 0 deletions assert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global.assert = require('./src').assert;
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
declare module 'riteway' {
export function assert<T>(assertion: Assertion<T>): void;

interface Assertion<T> {
readonly given: any;
readonly should: string;
readonly actual: T;
readonly expected: T;
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "riteway-jest",
"version": "1.0.0",
"version": "1.0.1",
"description": "Unit tests that always supply a good bug report when they fail for Jest.",
"main": "src/index.js",
"scripts": {
Expand Down

0 comments on commit 49686ca

Please sign in to comment.