Skip to content

Commit

Permalink
test(client): add tests for client parser that will be run by karma
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Nov 3, 2019
1 parent d095d29 commit a0c58aa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/client/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var assert = window.chai.assert;
var htmlCases = require('../cases/html');
var htmlparser = require('../../dist/htmlparser2');
var parser = require('../../lib/html-to-dom-client');
var helpers = require('../helpers');

describe('client parser', function() {
helpers.throwsError(parser, assert);
helpers.runTests(htmlCases, parser, htmlparser.parseDOM, assert);

it.skip('performance', function() {
var html = '<div>test</div>';
var start = performance.now();
var times = 1000;
while (--times) {
parser(html);
}
var end = performance.now();
console.log('performance: ' + (end - start) + ' milliseconds'); // eslint-disable-line no-console
});
});

0 comments on commit a0c58aa

Please sign in to comment.