Skip to content

Commit 9cbf64c

Browse files
committed
Pass conditions from options, update async test
1 parent a818709 commit 9cbf64c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/jest-resolve/src/__tests__/resolve.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ describe('findNodeModuleAsync', () => {
171171
const newPath = await Resolver.findNodeModuleAsync('test', {
172172
basedir: '/',
173173
browser: true,
174+
conditions: ['conditions, woooo'],
174175
extensions: ['js'],
175176
moduleDirectory: ['node_modules'],
176177
paths: ['/something'],
@@ -182,6 +183,7 @@ describe('findNodeModuleAsync', () => {
182183
expect(userResolverAsync.async.mock.calls[0][1]).toStrictEqual({
183184
basedir: '/',
184185
browser: true,
186+
conditions: ['conditions, woooo'],
185187
defaultResolver: defaultResolverAsync,
186188
extensions: ['js'],
187189
moduleDirectory: ['node_modules'],

packages/jest-resolve/src/resolver.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export default class Resolver {
132132
return resolver(path, {
133133
basedir: options.basedir,
134134
browser: options.browser,
135+
conditions: options.conditions,
135136
defaultResolver,
136137
extensions: options.extensions,
137138
moduleDirectory: options.moduleDirectory,
@@ -165,6 +166,7 @@ export default class Resolver {
165166
const result = await resolver(path, {
166167
basedir: options.basedir,
167168
browser: options.browser,
169+
conditions: options.conditions,
168170
defaultResolver: defaultResolverAsync,
169171
extensions: options.extensions,
170172
moduleDirectory: options.moduleDirectory,

0 commit comments

Comments
 (0)