Files
30-seconds-of-code/test/insertAfter.test.js
Angelos Chalaris e815dd1dfb Additional tests
2018-11-07 15:03:27 +02:00

14 lines
392 B
JavaScript

const expect = require('expect');
const {insertAfter} = require('./_30s.js');
test('insertAfter is a Function', () => {
expect(insertAfter).toBeInstanceOf(Function);
});
let e = document.createElement('div');
e.setAttribute("id", "test");
test('Does not throw error if the element exists', () => {
expect(() => {
insertAfter(e, '<span>test</span>');
}).not.toThrow(TypeError);
});