tinyspy
uvu-expect
tinyspy | uvu-expect | |
---|---|---|
2 | 1 | |
203 | 1 | |
- | - | |
9.1 | 1.8 | |
about 2 years ago | about 2 years ago | |
TypeScript | TypeScript | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tinyspy
-
Testing your Solid.js code in vitest
You may have heard of vite, the slim fast dev server that scored an amazing as deserved 98% satisfaction on the state of js survey 2021. It's creators found unit testing too cumbersome and slow and decided to add their own perspective to the task. The result is vitest: it runs a vite server under the hood to transform the code to test as fast as possible, uses an enhanced flavor of chai to have jest-compatible assertions, integrates DOM mocking using jsdom or happy-dom and even the tiny-spy library that was just built as a separate library to allow for easy reuse is small and compatible with jest.
-
Creating a Chai like assertion library using proxies
Assertions on mock functions (compatible with sinonjs and tinyspy).
uvu-expect
-
Creating a Chai like assertion library using proxies
This setup works really good! But there’s some minor details: The assertion errors thrown by Chai are slightly different than those expected by uvu., so sometimes I’d get messages or extra details that are not so relevant to the test itself. Another issue is that I’d receive diffs comparing undefined to undefined when an assertion failed. As a proper developer with too much free time, I went ahead and decided to experiment with writing my own assertion library built on top of uvu’s assertions that I called uvu-expect. Here’s more or less how I did it.
What are some alternatives?
vitest - Next generation testing framework powered by Vite.
mocha - ☕️ simple, flexible, fun javascript test framework for node.js & the browser
happy-dom - A JavaScript implementation of a web browser without its graphical user interface
sveltekit-uvu-testing - SvelteKit uvu testing: how you can easily add fast component and utility function unit tests to your Svelte app using uvu with TypeScript.
felte - An extensible form library for Svelte, Solid and React
aws-testing-library - Chai (https://chaijs.com) and Jest (https://jestjs.io/) assertions for testing services built with aws
vitest-mongodb - Run your tests with Vitest and MongoDB Memory server.
uvu-expect-dom - Dom assertions for uvu-expect built on top of jest-dom
jest-html-reporter - Jest test results processor for generating a summary in HTML
uvu - uvu is an extremely fast and lightweight test runner for Node.js and the browser