1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-06-16 07:07:37 +02:00
cheatsheets/qunit.md
2020-07-03 22:47:47 +10:00

691 B

title category layout intro
Qunit JavaScript libraries 2017/sheet A quick reference for the [QUnit](https://yarnpkg.com/package/qunit) testing library in JavaScript.
QUnit.module('a')
QUnit.test('ok', function (t) {
  /* ... */
})

Hooks

Each test

// each test
QUnit.testStart(function)
QUnit.testEnd(function)
// each module
QUnit.moduleStart(function)
QUnit.moduleEnd(function)
// all
QUnit.begin(function)
QUnit.done(function)

Assertions

t.equal(actual, expected)
t.deepEqual(actual, expected)
t.strictEqual(actual, expected)
t.propEqual(actual, expected)
t.notEqual(actual, expected)
t.expect(amount)