Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Jest globals 2 #65

Open
wants to merge 11 commits into
base: jest-globals
Choose a base branch
from
Open

[WIP] Jest globals 2 #65

wants to merge 11 commits into from

Conversation

andrewiggins
Copy link
Collaborator

My attempt to include more Jest globals. Sharing to get early feedback though I need to take a break from this for now to focus on other things.

fakeTimers.test.js has two tests failing right now because I think some tests are improperly leaking changed globals between tests.

But I think this PR gets Jest's fn() mocking function and fake timers API working!

"build": "microbundle --target node -f cjs --no-compress src/index.js src/cli.js src/appender.js",
"build": "npm run build:node && npm run build:web",
"build:node": "microbundle --target node -f cjs --no-compress src/index.js src/cli.js src/appender.js",
"build:web": "microbundle -f iife --no-compress --external none --alias jest-message-util=C:\\code\\github\\developit\\karmatic\\src\\lib\\jest\\messageUtilFake.js --define process.env.NODE_ENV=production -i src/lib/jest-globals.js -o dist/lib/jest-globals.js",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm bundling jest-globals.js separately at build time to avoid our users having to re-bundle all the jest stuff on each run of karmatic. Probably need to move some of these deps into devDeps since they are bundled. Or maybe move them to bundledDeps?

Also need to figure out/fix how to specify aliases in microbundle so that it doesn't require absolute paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant