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

Missing jest timers, test.each, and module mocks #3594

Open
philipheinser opened this issue Jul 10, 2023 · 12 comments
Open

Missing jest timers, test.each, and module mocks #3594

philipheinser opened this issue Jul 10, 2023 · 12 comments
Labels
enhancement New feature or request jest Something related to the `bun test` runner

Comments

@philipheinser
Copy link

philipheinser commented Jul 10, 2023

What is the problem this feature would solve?

we could use it for tests

What is the feature you are proposing to solve the problem?

TypeError: jest.runAllTimers is not a function.

TypeError: it.each is not a function.

TypeError: jest.resetModules is not a function.

What alternatives have you considered?

No response

@philipheinser philipheinser added the enhancement New feature or request label Jul 10, 2023
@trnxdev
Copy link
Contributor

trnxdev commented Jul 10, 2023

Uhm, could you provide more information about what you mean? bun test is already implemented.

@Jarred-Sumner Jarred-Sumner changed the title bun test Missing jest timers, test.each, and module mocks Jul 10, 2023
@robobun robobun added the jest Something related to the `bun test` runner label Jul 10, 2023
@trnxdev
Copy link
Contributor

trnxdev commented Jul 13, 2023

Regarding test.each it's being tracked in #3622

@philipheinser
Copy link
Author

@TiranexDev I get the following error in bun test TypeError: jest.resetModules is not a function. (In 'jest.resetModules()', 'jest.resetModules' is undefined) with node its runs fine.

@trnxdev
Copy link
Contributor

trnxdev commented Aug 24, 2023

@TiranexDev I get the following error in bun test TypeError: jest.resetModules is not a function. (In 'jest.resetModules()', 'jest.resetModules' is undefined) with node its runs fine.

Probably because bun doesn't implement it, just wait a bit and we will get it done

@varjmes
Copy link

varjmes commented Sep 8, 2023

Just coming here to say jest.clearAllTimers is not implemented, which means I can't use it at work right now. But that's okay, looking forward to trying it out on personal projects :)

@elsassph
Copy link

We're using a few other timer functions which seem to be missing:

  • jest.advanceTimersByTime(ms)
  • jest.runOnlyPendingTimers()
  • jest.runAllTimers()

@boredland
Copy link

I didn't try it, but is module mocking already possible in bun-test?

@TroyAlford
Copy link

TroyAlford commented Sep 10, 2023 via email

@ReneWerner87
Copy link

any news on this? full support for jest would be great

@Jarred-Sumner
Copy link
Collaborator

module mocks and test.each are implemented

timers are still missing

@manast
Copy link

manast commented Mar 19, 2024

I see "resetModules" have been strikedthrough, but I cannot find a way to achieve this functionality, does anybody know how?

@philipheinser
Copy link
Author

@manast sorry also fail for me. removed the strikedthrough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jest Something related to the `bun test` runner
Projects
None yet
Development

No branches or pull requests

10 participants