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

14 lines
396 B
JavaScript

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