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

Add unit tests #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add unit tests #75

wants to merge 4 commits into from

Conversation

m4rvr
Copy link
Contributor

@m4rvr m4rvr commented Aug 4, 2021

This PR adds some basic unit test setup with jest + esbuild-jest. Currently, only a few utils are tested.
Also, the test script/command needs to be run manually.

@frandiox
Copy link
Owner

@MarvinRudolph Thanks! As mentioned on Twitter DMs, we are going to use uvu instead of Jest. The other PR was already merged so we should adapt this PR to the new structure.

@m3hari How should we handle unit tests like the ones in this PR? Also in test/specs or somewhere else? 🤔

@frandiox frandiox changed the title Add tests Add unit tests Aug 16, 2021
@m3hari
Copy link
Collaborator

m3hari commented Aug 23, 2021

Apologies for the late reply, I think unit tests are better placed next to the file to be tested. uvu should find it with minor changes on the test command. Here is the docs for uvu test file matching

@frandiox
Copy link
Owner

@m3hari Thanks!

@MarvinRudolph Do you want to transform this to use uvu? For example, if you want to test utils/html.ts then the spec can be located next to it, in utils/html.unit.ts or utils/html.spec.ts.

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.

3 participants