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

Support mocking new Date() & Date.now() in bun:test #3501

Merged
merged 3 commits into from
Jul 3, 2023

Conversation

Jarred-Sumner
Copy link
Collaborator

This depends on oven-sh/WebKit@26c8197

This works at a lower level than Jest's implementation. That means:

  • Date.now, new Date() remain === after fake timers are enabled
  • new Intl.DateTimeFormat().format() uses the mocked time

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

@Jarred-Sumner 7 files with test failures on linux-x64-baseline:

  • test/cli/install/bun-run.test.ts
  • test/js/bun/websocket/websocket-server.test.ts
  • test/js/node/watch/fs.watch.test.js
  • test/js/third_party/prisma/prisma.test.ts
  • test/js/third_party/socket.io/socket.io-close.test.ts
  • test/js/third_party/socket.io/socket.io-connection-state-recovery.test.ts
  • test/js/web/websocket/websocket.test.js

View test output

#5159f93bec286a379a9b7109764fe25f675004c0

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

@Jarred-Sumner 7 files with test failures on linux-x64:

  • test/cli/install/bun-run.test.ts
  • test/js/bun/websocket/websocket-server.test.ts
  • test/js/node/watch/fs.watch.test.js
  • test/js/third_party/prisma/prisma.test.ts
  • test/js/third_party/socket.io/socket.io-close.test.ts
  • test/js/third_party/socket.io/socket.io-connection-state-recovery.test.ts
  • test/js/web/websocket/websocket.test.js

View test output

#5159f93bec286a379a9b7109764fe25f675004c0

@github-actions
Copy link

github-actions bot commented Jul 3, 2023

@Jarred-Sumner 8 files with test failures on bun-darwin-aarch64:

  • test/cli/install/bun-run.test.ts
  • test/js/bun/spawn/spawn.test.ts
  • test/js/bun/test/test-test.test.ts
  • test/js/bun/websocket/websocket-server.test.ts
  • test/js/third_party/socket.io/socket.io-close.test.ts
  • test/js/third_party/socket.io/socket.io-connection-state-recovery.test.ts
  • test/js/web/fetch/fetch-leak.test.js
  • test/js/web/websocket/websocket.test.js

View test output

#5159f93bec286a379a9b7109764fe25f675004c0

@Jarred-Sumner Jarred-Sumner merged commit aa38e51 into main Jul 3, 2023
15 of 18 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/start-of-timers branch July 3, 2023 05:09
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

@Jarred-Sumner 10 files with test failures on bun-darwin-x64-baseline:

  • test/cli/install/bun-run.test.ts
  • test/js/bun/spawn/spawn-streaming-stdin.test.ts
  • test/js/bun/spawn/spawn.test.ts
  • test/js/bun/sqlite/sqlite.test.js
  • test/js/bun/websocket/websocket-server.test.ts
  • test/js/third_party/socket.io/socket.io-close.test.ts
  • test/js/third_party/socket.io/socket.io-connection-state-recovery.test.ts
  • test/js/third_party/webpack/webpack.test.ts
  • test/js/web/timers/setTimeout.test.js
  • test/js/web/websocket/websocket.test.js

View test output

#5159f93bec286a379a9b7109764fe25f675004c0

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