QUnit
≈ 1 min read
Names in other languages
- DeutschQUnit
- EnglishQUnit
- EspañolQUnit
- ItalianoQUnit
- 日本語QUnit
- PortuguêsQUnit
- СрпскиQUnit
- УкраїнськаQUnit
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
QUnit is a JavaScript framework for unit testing. Originally developed for testing jQuery, jQuery UI and jQuery Mobile, it is a generic framework for testing any JavaScript code. It supports client-side environments in web browsers, and server-side (e.g. Node.js). QUnit's assertion methods follow the CommonJS unit testing specification, which itself was influenced to some degree by QUnit.
QUnit is a JavaScript framework for unit testing. Originally developed for testing jQuery, jQuery UI and jQuery Mobile, it is a generic framework for testing any JavaScript code. It supports client-side environments in web browsers, and server-side (e.g. Node.js). QUnit's assertion methods follow the CommonJS unit testing specification, which itself was influenced to some degree by QUnit. QUnit.test('a basic test example', function (assert) { var obj = {}; assert.ok(true, 'Boolean true'); // passes assert.ok(1, 'Number one'); // passes assert.ok(false, 'Boolean false'); // fails obj.start = 'Hello'; obj.end = 'Ciao'; assert.equal(obj.start, 'Hello', 'Opening greet'); // passes assert.equal(obj.end, 'Goodbye', 'Closing greet'); // fails });
Text derived from https://en.wikipedia.org/w/index.php?oldid=1328765642 under CC BY-SA 4.0; modifications have been made.