From efa56666481b9fd27f29e35079214ca51fc03f97 Mon Sep 17 00:00:00 2001 From: Ian Purvis Date: Wed, 29 Mar 2023 15:55:24 -0500 Subject: [PATCH 1/6] Add typescript note to README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 1d9adb9..e10875b 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,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). From 42844e2d4393475e08b79cf5afdc8e2100c3e6cb Mon Sep 17 00:00:00 2001 From: Ian Purvis Date: Wed, 29 Mar 2023 15:56:55 -0500 Subject: [PATCH 2/6] Migrate README getting started to published package --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e10875b..8d68ddc 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ 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: From 0fe42a0dec1f7496f4feec4b818e097f83caf207 Mon Sep 17 00:00:00 2001 From: Ian Purvis Date: Wed, 29 Mar 2023 15:35:37 -0500 Subject: [PATCH 3/6] Add keywords to package config --- package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 49985d8..4d243e5 100644 --- a/package.json +++ b/package.json @@ -26,5 +26,12 @@ }, "peerDependencies": { "jest": ">=25.5.0" - } + }, + "keywords": [ + "jest", + "context", + "test", + "testing", + "javascript" + ] } From 5f80edcafee5e9d807a1931b1274dced9e678301 Mon Sep 17 00:00:00 2001 From: Ian Purvis Date: Wed, 29 Mar 2023 15:58:13 -0500 Subject: [PATCH 4/6] Add repository to package config --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 4d243e5..791b379 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,10 @@ "version": "0.0.0", "description": "Pass context to jest hooks and tests", "author": "Ian Purvis ", + "repository": { + "type": "git", + "url": "https://github.com/ianpurvis/jest-ctx.git" + }, "license": "MIT", "type": "module", "exports": { From 43bbd09e99085c13dbd035d80b5e1c63c9c383ff Mon Sep 17 00:00:00 2001 From: Ian Purvis Date: Wed, 29 Mar 2023 15:36:27 -0500 Subject: [PATCH 5/6] Bump version to 1.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 32fdc56..6efc13f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jest-ctx", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jest-ctx", - "version": "0.0.0", + "version": "1.0.0", "license": "MIT", "devDependencies": { "jest": "^29.4.3", diff --git a/package.json b/package.json index 791b379..4507198 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jest-ctx", - "version": "0.0.0", + "version": "1.0.0", "description": "Pass context to jest hooks and tests", "author": "Ian Purvis ", "repository": { From f4c588f40dfb0afb8bfb12f79a59c2876e8e1684 Mon Sep 17 00:00:00 2001 From: Ian Purvis Date: Wed, 29 Mar 2023 16:02:48 -0500 Subject: [PATCH 6/6] Add CI and codecov badges to README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8d68ddc..6a74006 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![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.