add 1st browser test, fix jsdom to be in devDependencies
This commit is contained in:
@ -1,10 +1,17 @@
|
||||
const test = require('tape');
|
||||
const hasClass = require('./hasClass.js');
|
||||
const jsdom = require('jsdom');
|
||||
const { JSDOM } = jsdom;
|
||||
|
||||
test('Testing hasClass', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof hasClass === 'function', 'hasClass is a Function');
|
||||
const className = 'container'
|
||||
const dom = new JSDOM(`
|
||||
<p class="container">Some text</p>
|
||||
`);
|
||||
t.true(hasClass(dom.window.document.querySelector('p'), 'container'), 'element has the specified class');
|
||||
//t.deepEqual(hasClass(args..), 'Expected');
|
||||
//t.equal(hasClass(args..), 'Expected');
|
||||
//t.false(hasClass(args..), 'Expected');
|
||||
|
||||
Reference in New Issue
Block a user