From ec3775ba208d416434b9fad45c1bdfce92cfdd54 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Sun, 19 Jun 2016 19:21:28 +0100 Subject: [PATCH] Add tests for unordered args --- ...s should be able to be passed in in either order.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/Arguments should be able to be passed in in either order.js 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 in either order.js new file mode 100644 index 0000000..272c891 --- /dev/null +++ b/test/Arguments should be able to be passed in in either order.js @@ -0,0 +1,10 @@ +import test from 'ava'; +import browserEnv from '../dist'; + +test(t => { + t.is(typeof navigator, 'undefined'); + const returnValue = browserEnv(['navigator'], { userAgent: 'first' }); + t.is(navigator.userAgent, 'first'); + const secondReturnValue = browserEnv({ userAgent: 'second' }, ['navigator']); + t.is(navigator.userAgent, 'second'); +});