diff --git a/package.json b/package.json index 90bb8b6..a6f7d2a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "window": "4.2.6" }, "devDependencies": { - "ava": "^0.25.0", + "ava": "^1.2.0", "coveralls": "^3.0.0", "eslint-config-xo-lukechilds": "^1.0.0", "nyc": "^11.0.2", diff --git a/test/arguments-should-be-able-to-be-passed-in-in-either-order.js b/test/arguments-should-be-able-to-be-passed-in-either-order.js similarity index 80% rename from test/arguments-should-be-able-to-be-passed-in-in-either-order.js rename to test/arguments-should-be-able-to-be-passed-in-either-order.js index 4ca39ae..c812ea3 100644 --- a/test/arguments-should-be-able-to-be-passed-in-in-either-order.js +++ b/test/arguments-should-be-able-to-be-passed-in-either-order.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Arguments should be able to be passed in either order', t => { t.is(typeof navigator, 'undefined'); browserEnv(['navigator'], { userAgent: 'first' }); t.is(navigator.userAgent, 'first'); diff --git a/test/existing-falsey-node-globals-dont-get-overwritten.js b/test/existing-falsy-node-globals-dont-get-overwritten.js similarity index 60% rename from test/existing-falsey-node-globals-dont-get-overwritten.js rename to test/existing-falsy-node-globals-dont-get-overwritten.js index 1b47daf..9d0efff 100644 --- a/test/existing-falsey-node-globals-dont-get-overwritten.js +++ b/test/existing-falsy-node-globals-dont-get-overwritten.js @@ -1,9 +1,10 @@ import test from 'ava'; +import browserEnv from '../src'; // We have to require() here as imports have to be top level so we can't set // globals first -test(t => { +test('Existing falsy node globals don\'t get overwritten', t => { global.document = false; - require('../src')(); + browserEnv(); t.is(document, false); }); diff --git a/test/existing-node-globals-shouldnt-get-overwritten.js b/test/existing-node-globals-shouldnt-get-overwritten.js index 7c7b13d..7aaf241 100644 --- a/test/existing-node-globals-shouldnt-get-overwritten.js +++ b/test/existing-node-globals-shouldnt-get-overwritten.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Existing node globals shouldn\'t get overwritten', t => { const origConsole = console; browserEnv(); t.is(origConsole, console); diff --git a/test/function-should-overwrite-dom-globals-on-each-call.js b/test/function-should-overwrite-dom-globals-on-each-call.js index af83692..403208a 100644 --- a/test/function-should-overwrite-dom-globals-on-each-call.js +++ b/test/function-should-overwrite-dom-globals-on-each-call.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Function should overwrite DOM globals on each call', t => { t.is(typeof window, 'undefined'); const returnValue = browserEnv(); t.is(returnValue, window); diff --git a/test/function-should-return-window-instance.js b/test/function-should-return-window-instance.js index 9b5dbc6..1b9c89b 100644 --- a/test/function-should-return-window-instance.js +++ b/test/function-should-return-window-instance.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Function should return window instance', t => { const returnValue = browserEnv(); t.is(returnValue, window); }); diff --git a/test/function-should-setup-browser-environment.js b/test/function-should-setup-browser-environment.js index 15d857f..3a3b8dc 100644 --- a/test/function-should-setup-browser-environment.js +++ b/test/function-should-setup-browser-environment.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Function should setup browser environment', t => { t.is(typeof window, 'undefined'); t.is(typeof document, 'undefined'); t.is(typeof navigator, 'undefined'); diff --git a/test/function-shouldnt-return-the-same-instance.js b/test/function-shouldnt-return-the-same-instance.js index eeaf1b9..efe0437 100644 --- a/test/function-shouldnt-return-the-same-instance.js +++ b/test/function-shouldnt-return-the-same-instance.js @@ -1,6 +1,6 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Function shouldn\'t return the same instance', t => { t.not(browserEnv(), browserEnv()); }); diff --git a/test/jsdom-arg-should-set-jsdom-config.js b/test/jsdom-arg-should-set-jsdom-config.js index fd69634..72cff4f 100644 --- a/test/jsdom-arg-should-set-jsdom-config.js +++ b/test/jsdom-arg-should-set-jsdom-config.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('JsDOM arg should set JsDOM config', t => { const userAgent = 'Custom user agent'; t.is(typeof navigator, 'undefined'); browserEnv(['navigator'], { userAgent }); diff --git a/test/properties-arg-should-set-globals.js b/test/properties-arg-should-set-globals.js index 46f8e53..900a72d 100644 --- a/test/properties-arg-should-set-globals.js +++ b/test/properties-arg-should-set-globals.js @@ -1,7 +1,7 @@ import test from 'ava'; import browserEnv from '../src'; -test(t => { +test('Properties arg should set globals', t => { t.is(typeof window, 'undefined'); t.is(typeof document, 'undefined'); t.is(typeof navigator, 'undefined'); diff --git a/test/window-properties-should-be-as-expected.js b/test/window-properties-should-be-as-expected.js index 9d13f2b..bc2aeca 100644 --- a/test/window-properties-should-be-as-expected.js +++ b/test/window-properties-should-be-as-expected.js @@ -2,7 +2,7 @@ import test from 'ava'; import browserEnv from '../src'; import expectedProperties from './fixtures/expectedProperties'; -test(t => { +test('Window properties should be as expected', t => { browserEnv(); const properties = Object.getOwnPropertyNames(window); t.deepEqual(expectedProperties.sort(), properties.sort());