Add tests for 2 browser snippets
This commit is contained in:
@ -4,3 +4,10 @@ const {createElement} = require('./_30s.js');
|
||||
test('createElement is a Function', () => {
|
||||
expect(createElement).toBeInstanceOf(Function);
|
||||
});
|
||||
test('createElement creates an element', () => {
|
||||
expect(createElement(
|
||||
`<div class="container">
|
||||
<p>Hello!</p>
|
||||
</div>`
|
||||
).className).toEqual('container');
|
||||
});
|
||||
|
||||
@ -4,3 +4,6 @@ const {currentURL} = require('./_30s.js');
|
||||
test('currentURL is a Function', () => {
|
||||
expect(currentURL).toBeInstanceOf(Function);
|
||||
});
|
||||
test('currentURL returns the appropriate value', () => {
|
||||
expect(currentURL()).toEqual(global.location.href);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user