Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
This is an experimental project with a very simple (and incomplete) unit tests tool written using ES6 features.
Clone it!
git clone git@github.com:leobalter/goiabada.git
Install npm dependencies
npm install
Run npm test
to see it working.
Import goiabada and instance a new object:
import Goiabada from "goiabada";
var goiabada = new Goiabada();
Write your tests using the test
method, catch the assert
parameter and write your assertions, call end()
when you're done testing.
goiabada.test( assert => {
assert.ok( true, "it works!" );
assert.end();
});
If you prefer calling only test
, without the namespace, you can add this line:
var test = goiabada.test.bind( goiabada );
ok( value[, message ] )
: pass when the value is truthy.
Returns the result.equal( value, expected[, message ] )
: non strict comparison (==
).
Returns the result.same( value, expected[, message ] )
: strict comparison (===
).
Returns the result.throws( fn[, message ] )
: passes when the given fn throws an error.
Returns the error.expect( n )
: expects a number of given assertions to run from that point.
The last expected assertion will trigger the end()
method.end()
: when triggered manually will close the test in order the to run the following.
It will trigger an error if you still have remaining tests set from expect()
.
It will also trigger an error for each of consecutive assertion in the same test block.remaining
: if you call expect(n)
, this will receive a number value with the remaining tests to run.error
: push an error to the test logassertions
: the executed assertionspassed
: the passing assertionsfailed
: the failing assertionsYou can set a different logger on Goiabada. It's not standardized yet but my goal is to follow the possible conventions from https://github.com/js-reporters/js-reporters
FAQs
Experimental es6 unit tests project
We found that goiabada demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.