1 | import test from 'ava';
|
2 | import browserEnv from '../src';
|
3 |
|
4 | test('Function should setup browser environment', t => {
|
5 | t.is(typeof window, 'undefined');
|
6 | t.is(typeof document, 'undefined');
|
7 | t.is(typeof navigator, 'undefined');
|
8 | t.is(typeof HTMLElement, 'undefined');
|
9 | browserEnv();
|
10 | t.not(typeof window, 'undefined');
|
11 | t.not(typeof document, 'undefined');
|
12 | t.not(typeof navigator, 'undefined');
|
13 | t.not(typeof HTMLElement, 'undefined');
|
14 | });
|
15 |
|
16 | test('Function should return window instance', t => {
|
17 | const returnValue = browserEnv();
|
18 | t.is(returnValue, window);
|
19 | });
|