UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

21 lines (13 loc) 485 B
const mod = require('./lib/regular_module.js') describe("My test suite", t => { t.it("Excersizing code", t => { t.is(mod.value, 11, "Correct `value` exported") t.is(mod.func(11), 53, 'Correct `func` exported') }) t.it("Excersizing `delay` function", async t => { const time = new Date() await mod.delay(100) // sometimes delay is actually 99 t.isGE(new Date() - time, 99, "Should delay for >= 100ms") }) })