Browse Source

Since AVA@0.25, all tests should have a title.

pull/73/head
Guillaume Martigny 6 years ago
parent
commit
2968819ba4
  1. 2
      package.json
  2. 2
      test/arguments-should-be-able-to-be-passed-in-either-order.js
  3. 5
      test/existing-falsy-node-globals-dont-get-overwritten.js
  4. 2
      test/existing-node-globals-shouldnt-get-overwritten.js
  5. 2
      test/function-should-overwrite-dom-globals-on-each-call.js
  6. 2
      test/function-should-return-window-instance.js
  7. 2
      test/function-should-setup-browser-environment.js
  8. 2
      test/function-shouldnt-return-the-same-instance.js
  9. 2
      test/jsdom-arg-should-set-jsdom-config.js
  10. 2
      test/properties-arg-should-set-globals.js
  11. 2
      test/window-properties-should-be-as-expected.js

2
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",

2
test/arguments-should-be-able-to-be-passed-in-in-either-order.js → 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');

5
test/existing-falsey-node-globals-dont-get-overwritten.js → 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);
});

2
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);

2
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);

2
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);
});

2
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');

2
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());
});

2
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 });

2
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');

2
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());

Loading…
Cancel
Save