sengitu / kavun Goto Github PK
View Code? Open in Web Editor NEWKavun is a light weight spec runner library for Javascript.
Kavun is a light weight spec runner library for Javascript.
Units should have a timeout and should be failed if exceeds that amount of time. Timeout should also be configurable for each tests.
Kavun gracefully shuts down even if a unit test is broken. It reports the number of failed and succeeded tests.
For now, it neither creates a file to provide results to CI, nor returns an error exit value. Even if the tests are broken, CI will not probably fail. Oops.
Create a new branch and write a failing test to see the behaviour. Find a way to fix that if CI build does not fail.
Instead of running test each time, kavun should be able to up all the time and track the changed files. By that way, it can re-run tests in the changed files.
Running only changed files could bring complexity, the first step should be running all tests if there is a change in a file we track.
For now, in order to gain watch ability, we can suggest watch -n 2 npm run test
.
Currently library is able to handle assertion errors correctly, but in case of other kind of error it returns meaningless message.
Execute.js should be able to return error and a new layer should be able to distinguish types of errors.
I would be interested in seeing a reporter that shows the timing of each test run.
This might inspire other interesting reporters.
Right now, spec runner accepts only folder as a path to discover tests. It also should be able to work if specified path is a file instead of a directory.
Create functionalities to test methods like setTimeout or setInterval. Provide an interface to keep process waiting for a while. In a project, I've used following code snippet to simulate actual wait, this functionality should be provided by kavun itself.
const waitOneSecond = () =>
new Promise(resolve => {
setTimeout(() => {
resolve();
}, 1000);
});
spec('someSpec', () => {
unit('someUnit', async () => {
await waitOneSecond();
})
})
Right now, if there is an on-going interval, even if tests complete running, process does not returns. Either we would override interval and timeout's to keep their references, or we can stop the process after we make sure that every test has ran.
According to nodejs' documentation about process.hrtime
, it's value alone is meaningless. We should get difference between two intervals to get an accurate meaningful solution.
process.hrtime's optional time parameter does the diff calculation, which we can remove. Also overall run time is difference of last hrtime to 0, which is meaningless according to document.
Make sure that every commit gets validated by running their tests.
How? There are many ways, figure out which one you like and what you need.
Expected and actual values are key parts of a test framework. They should give the necessary feedback.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.