Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from 'ts-jest/utils' | ||
export {pathsToModuleNameMapper, createJestPreset} from 'ts-jest' |