Repository
Current version released
5 years ago
Versions
machiatto
This module provides a Mocha-like interface with support for full async functions across the board. Hopefully it just works.
Install
import * as Machiatto from 'https://deno.land/x/machiatto'
Usage
It’s mostly just like Mocha.
The module provides the following exports:
describecreates a new nested suite of testsitdefines a new test in the current suitebeforeruns once before any tests in the suitebeforeEachruns before each test in the suiteafterruns once after all tests in the suiteafterEachruns after each test in the suiterunactually executes the tests
All functions passed can be async and will be executed in defined order, with the exception of tests - tests are run in parallel.
export { expect } from "https://deno.land/x/expect@v0.2.6/mod.ts";
import { beforeEach, describe, it, run } from "../test.ts";
import { clone } from './date.ts'
describe('date.ts', function() {
beforeEach(function() {
this.date = new Date('04/09/2021')
})
describe('#clone', function() {
beforeEach(function() {
this.cloned = clone(this.date)
})
it('returns a date from the exact same time', function() {
expect(this.date.getTime()).toEqual(this.cloned.getTime())
})
it('returns a different date object', function() {
expect(this.date).not.toBe(this.cloned)
})
})
})
await run()