-
Notifications
You must be signed in to change notification settings - Fork 25
Jest Config and Tricks
veeramarni edited this page Jun 14, 2019
·
5 revisions
For example, if we have
// packageB/sample.test.ts
import { something } from 'packageA';
If packageA
has a packageB
dependency, then jest will invoke packageB/lib/index.js
. If we need to map to packageB/src/index.ts
we can do using moduleNameMapper
.
moduleNameMapper: {
'@sample-stack/server-core': '<rootDir>/packages/sample-server-core/src/index.ts'
},
https://stackoverflow.com/questions/49044994/how-can-i-test-part-of-object-using-jest