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

Use Node's Native Test Runner instead of Jest #9

Closed
thiagomini opened this issue Feb 13, 2024 · 3 comments · Fixed by #14
Closed

Use Node's Native Test Runner instead of Jest #9

thiagomini opened this issue Feb 13, 2024 · 3 comments · Fixed by #14
Labels
enhancement New feature or request testing

Comments

@thiagomini
Copy link
Contributor

Hey there, Oskar - I really appreciate the effort of creating a Node version of Marten, which is something I've been missing in the JS ecosystem. As a fellow TS programmer and Event-sourcing enthusiast, I'd like to contribute to this tool - and my first suggestion is to use Node's native test runner to run its tests. It is way faster than Jest, and it's one less dependency in the repo, which is always great.

I've created a repo showing how easy it is to set it up with Typescript, and you'll see that it's API is basically the same as Jest or other famous test runners (like Vitest). The idea is to improve the DevEx for the contributors of this package by leveraging native tools.

I can create a PR to configure the repo to use it - just let me know if you agree!

@oskardudycz
Copy link
Collaborator

@thiagomini, thank you for the kind words! 🙂I’d be happy to take contribution like that, actually I was a bit fed up with Jest as it looks like abandonware, I was considering switching to vitetest. TBT I didn’t know that Node has native testing tool 🙂 As you said, the less dependency the better.

Before you go with PR, one question: How does it deal with async setup? I’m planning to have a lot of integration tests, so that will be pretty important 🙂

@thiagomini
Copy link
Contributor Author

Hey again, Oskar, I'm happy to help! And I agree, Jest looks like abandonware 😄 I often advise avoiding it!

About the async setup, if you mean to use beforeEach() and beforeAll() async hooks, it works just the same as Jest, so no significant changes there! But if you mean global setup files and similar, we can run these tests programmatically by using the run command that accepts options

@oskardudycz
Copy link
Collaborator

Nah, beforeEach and beforeAll is good enough for me 🙂 If there’s also possibility to define file naming conventions like in Jest, so e.g. unit.test.ts, int.test.ts then I’m sold and green light from me 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants