Files
30-seconds-of-code/test/getStyle.test.js
Angelos Chalaris 79ec21be2e Additional tests
2018-11-10 11:12:59 +02:00

12 lines
358 B
JavaScript

const expect = require('expect');
const {getStyle} = require('./_30s.js');
test('getStyle is a Function', () => {
expect(getStyle).toBeInstanceOf(Function);
});
test('getStyle returns the proper value', () => {
let el = document.createElement('div');
el.setAttribute('style', 'font-size: 20px;');
expect(getStyle(el, 'font-size')).toBe('20px');
});