From eed2623d10645a6c2ff6fe91bac6f1d8b1aa2998 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Tue, 27 Sep 2022 17:40:49 +0200 Subject: [PATCH] feat(expect): Expose toThrowMatchers --- CHANGELOG.md | 1 + packages/expect/package.json | 3 ++- scripts/buildUtils.mjs | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84cb35b41293..b4885441b524 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - `[@jest/environment]` Allow `jest.mock` and `jest.doMock` to take a type argument ([#13254](https://github.com/facebook/jest/pull/13254)) - `[@jest/fake-timers]` Add `jest.now()` to return the current fake clock time ([#13244](https://github.com/facebook/jest/pull/13244), [13246](https://github.com/facebook/jest/pull/13246)) - `[@jest/mock]` Add `withImplementation` method for temporarily overriding a mock. +- `[expect]` Export `toThrow*` matchers ([#13328](https://github.com/facebook/jest/pull/13328)) ### Fixes diff --git a/packages/expect/package.json b/packages/expect/package.json index c4f13aba335c..e669780757f1 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -15,7 +15,8 @@ "default": "./build/index.js" }, "./package.json": "./package.json", - "./build/matchers": "./build/matchers.js" + "./build/matchers": "./build/matchers.js", + "./build/toThrowMatchers": "./build/toThrowMatchers.js" }, "dependencies": { "@jest/expect-utils": "workspace:^", diff --git a/scripts/buildUtils.mjs b/scripts/buildUtils.mjs index 12c3fecbbf63..9e12bededb69 100644 --- a/scripts/buildUtils.mjs +++ b/scripts/buildUtils.mjs @@ -67,7 +67,10 @@ export function getPackages() { ), ...(pkg.name === 'jest-circus' ? {'./runner': './runner.js'} : {}), ...(pkg.name === 'expect' - ? {'./build/matchers': './build/matchers.js'} + ? { + './build/matchers': './build/matchers.js', + './build/toThrowMatchers': './build/toThrowMatchers.js', + } : {}), }, `Package "${pkg.name}" does not export correct files`,