aGAIN
Açai Testing Framework documentation
A testing suite that proposes some tools that help you organize and easily escalate your own tests. ** Attention! ** All of tests in the same context are ran before tests on the following context.
Usage
Assertions should run inside of a test scope, see a simple example:
import test from "https://deno.land/x/acai_testing@1.0.3/mod.ts";
test("Test that 2 + 2 is equal 4", expect => {
expect(2 + 2).toEqual(4);
});
// You can run all the tests recorded using test.run, this will print
// in the console
test.run();
Automatic test find
You can automatically search for tests in your current project using test.find(/regex/)
, you can pass a regex to match a test file.
Grouping
You can group tests to easily distinguish between them without writing multiple files.
import test from "https://deno.land/x/acai_testing@1.0.3/mod.ts";
test.group("Group description", () => {
/*Your tests here*/
});
Except/Only
You can filter tests to be ran with except/only, working opposite of one another. They stack, so if you have two only tests, those two will run.
import test from "https://deno.land/x/acai_testing@1.0.3/mod.ts";
test.only("test description", () => {
// Your test here
});
You can also pass a second parameter to true, to force running all tests, ignoring the except/only.
Tag
You can tag your tests/groups, to filter them when running your tests. For example:
import test from "https://deno.land/x/acai_testing@1.0.3/mod.ts";
test("test description", () => {
// Your test here
}).tag(["tag1", "tag2"]);
test("other test description", () => {
// Your test here
}).tag(["tag3"]);
// Will only run tests marked with the tag2 tag
await test.run(["tag2"]);