Skip to content

Add unit tests - #75

Open
lockinmarv wants to merge 4 commits into
frandiox:masterfrom
lockinmarv:add-tests
Open

Add unit tests#75
lockinmarv wants to merge 4 commits into
frandiox:masterfrom
lockinmarv:add-tests

Conversation

@lockinmarv

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

m3hari commented Aug 23, 2021

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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