Skip to content

Commit 56756f9

Browse files
committed
fix(api/test): forward ts-jest utils from ts-jest, remove mocked
See: https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md#deprecations See: jestjs/jest#12089 BREAKING CHANGE: `api/test` no longer exports `mocked()`, it's available at `jest.mocked()` now
1 parent edea114 commit 56756f9

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/api/__tests__/test.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import * as utilsExports from 'ts-jest/utils'
1+
import * as utilsExports from 'ts-jest'
22
import * as testExports from '../test' // eslint-disable-line import/namespace
33

4+
const toForwardTsJest = ['pathsToModuleNameMapper', 'createJestPreset']
5+
46
describe('re-exporting ts-jest utils', () => {
5-
test.each(Object.entries(utilsExports).filter(([key]) => key !== 'default'))(
6-
'forwards `%s` export',
7-
(exportName, exportValue) => {
8-
expect(testExports).toHaveProperty(exportName, exportValue)
9-
},
10-
)
7+
test.each(
8+
Object.entries(utilsExports).filter(([key]) =>
9+
toForwardTsJest.includes(key),
10+
),
11+
)('forwards `%s` export', (exportName, exportValue) => {
12+
expect(testExports).toHaveProperty(exportName, exportValue)
13+
})
1114
})

src/api/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from 'ts-jest/utils'
1+
export {pathsToModuleNameMapper, createJestPreset} from 'ts-jest'

0 commit comments

Comments
 (0)