You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a library which loads different modules for node and browser using main and browser fields of package.json. I would like to resolve to the browser field when importing the library:
import { fn } from '..'
// fn should come from `browser` module
How do I do so with web test runner? I don't see anything in documentation regarding it.
Note that I'm hoping to use the same test files with both jest and web test runner to test node and browser modules, so keeping that possibility would be helpful
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a library which loads different modules for node and browser using
main
andbrowser
fields of package.json. I would like to resolve to thebrowser
field when importing the library:How do I do so with web test runner? I don't see anything in documentation regarding it.
Note that I'm hoping to use the same test files with both jest and web test runner to test node and browser modules, so keeping that possibility would be helpful
Beta Was this translation helpful? Give feedback.
All reactions