qunit-dom enables High Level DOM Assertions for QUnit.


Install qunit-dom using npm:

npm install --save-dev qunit-dom

or using yarn:

yarn add --dev qunit-dom

How to use it

Once installed the DOM element assertions are available at assert.dom(...).* :

test('the title is welcoming', function(assert) {
  assert.dom('#title').hasText('Welcome to QUnit');

More information

This is only a very brief overview of qunit-dom's features. More detailed docs can be found in the README or API docs