Skip to content

Commit

Permalink
release: 1.0.0 (#11)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ianpurvis authored Mar 29, 2023
1 parent 8860d89 commit 255c284
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[![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)
[![codecov](https://codecov.io/gh/ianpurvis/jest-ctx/branch/trunk/graph/badge.svg?token=6BGJQKMJEL)](https://codecov.io/gh/ianpurvis/jest-ctx)

# jest-ctx

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

## Getting Started

$ npm i -D github:ianpurvis/jest-ctx.git
$ npm i -D jest-ctx

$ yarn add -D github:ianpurvis/jest-ctx.git
$ yarn add -D jest-ctx

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


### Typescript

Types should work as usual except that hooks and tests can now receive and
return context:

beforeAll((): string => '🫐');
it('has typed context', (ctx: string) => expect(ctx).toMatch('🫐'));


## License

`jest-ctx` is available as open source under the terms of the [MIT License](LICENSE).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"name": "jest-ctx",
"version": "0.0.0",
"version": "1.0.0",
"description": "Pass context to jest hooks and tests",
"author": "Ian Purvis <ian@purvisresearch.com>",
"repository": {
"type": "git",
"url": "https://github.com/ianpurvis/jest-ctx.git"
},
"license": "MIT",
"type": "module",
"exports": {
Expand All @@ -26,5 +30,12 @@
},
"peerDependencies": {
"jest": ">=25.5.0"
}
},
"keywords": [
"jest",
"context",
"test",
"testing",
"javascript"
]
}

0 comments on commit 255c284

Please sign in to comment.