Skip to content

Commit

Permalink
fix(api/test): forward ts-jest utils from ts-jest, remove mocked
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jrolfs committed Jul 3, 2022
1 parent edea114 commit 56756f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/api/__tests__/test.js
@@ -1,11 +1,14 @@
import * as utilsExports from 'ts-jest/utils'
import * as utilsExports from 'ts-jest'
import * as testExports from '../test' // eslint-disable-line import/namespace

const toForwardTsJest = ['pathsToModuleNameMapper', 'createJestPreset']

describe('re-exporting ts-jest utils', () => {
test.each(Object.entries(utilsExports).filter(([key]) => key !== 'default'))(
'forwards `%s` export',
(exportName, exportValue) => {
expect(testExports).toHaveProperty(exportName, exportValue)
},
)
test.each(
Object.entries(utilsExports).filter(([key]) =>
toForwardTsJest.includes(key),
),
)('forwards `%s` export', (exportName, exportValue) => {
expect(testExports).toHaveProperty(exportName, exportValue)
})
})
2 changes: 1 addition & 1 deletion src/api/test.js
@@ -1 +1 @@
export * from 'ts-jest/utils'
export {pathsToModuleNameMapper, createJestPreset} from 'ts-jest'

0 comments on commit 56756f9

Please sign in to comment.