parseAttributes.test.js 502 B

123456789101112131415161718192021
  1. import {JSDOM} from 'jsdom';
  2. import QUnit from 'qunit';
  3. import { parseAttributes } from '../src/parseAttributes';
  4. const document = new JSDOM().window.document;
  5. QUnit.module('parseAttributes');
  6. QUnit.test('simple', function(assert) {
  7. const el = document.createElement('el');
  8. el.setAttribute('foo', 1);
  9. assert.deepEqual(parseAttributes(el), { foo: '1' });
  10. });
  11. QUnit.test('empty', function(assert) {
  12. const el = document.createElement('el');
  13. assert.deepEqual(parseAttributes(el), {});
  14. });