Skip to content

Commit 255c284

Browse files
authored
release: 1.0.0 (#11)
* Add typescript note to README * Update published package refs in README * Add keywords to package config * Add repository to package config * Add CI and codecov badges to README * Bump version to 1.0.0
1 parent 8860d89 commit 255c284

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
[![CI](https://github.com/ianpurvis/jest-ctx/actions/workflows/ci.yml/badge.svg?branch=trunk)](https://github.com/ianpurvis/jest-ctx/actions/workflows/ci.yml)
2+
[![codecov](https://codecov.io/gh/ianpurvis/jest-ctx/branch/trunk/graph/badge.svg?token=6BGJQKMJEL)](https://codecov.io/gh/ianpurvis/jest-ctx)
3+
14
# jest-ctx
25

36
Pass context to [Jest](https://jestjs.io) hooks and tests.
47

58
## Getting Started
69

7-
$ npm i -D github:ianpurvis/jest-ctx.git
10+
$ npm i -D jest-ctx
811

9-
$ yarn add -D github:ianpurvis/jest-ctx.git
12+
$ yarn add -D jest-ctx
1013

1114
`jest-ctx` exports the same module interface as `@jest/globals`, so it is easy
1215
to drop into your codebase:
@@ -197,6 +200,16 @@ by the usual args for each table row:
197200
`test.concurrent` and its variations are affected by a known issue with
198201
`beforeEach` (https://github.com/facebook/jest/issues/7997)
199202

203+
204+
### Typescript
205+
206+
Types should work as usual except that hooks and tests can now receive and
207+
return context:
208+
209+
beforeAll((): string => '🫐');
210+
it('has typed context', (ctx: string) => expect(ctx).toMatch('🫐'));
211+
212+
200213
## License
201214

202215
`jest-ctx` is available as open source under the terms of the [MIT License](LICENSE).

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"name": "jest-ctx",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"description": "Pass context to jest hooks and tests",
55
"author": "Ian Purvis <ian@purvisresearch.com>",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/ianpurvis/jest-ctx.git"
9+
},
610
"license": "MIT",
711
"type": "module",
812
"exports": {
@@ -26,5 +30,12 @@
2630
},
2731
"peerDependencies": {
2832
"jest": ">=25.5.0"
29-
}
33+
},
34+
"keywords": [
35+
"jest",
36+
"context",
37+
"test",
38+
"testing",
39+
"javascript"
40+
]
3041
}

0 commit comments

Comments
 (0)