From 2e8591a3f6f9ae32d3169e24122a2c4ea50ea235 Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Tue, 4 Jul 2017 02:21:34 -0700 Subject: [PATCH] Attempt to actually load the fetch polyfill --- nightwatch.json | 30 ++++++++++++++++-------------- test/nightwatch/globals.js | 7 +++++++ 2 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 test/nightwatch/globals.js diff --git a/nightwatch.json b/nightwatch.json index c0788ee..a51333d 100644 --- a/nightwatch.json +++ b/nightwatch.json @@ -1,17 +1,19 @@ { - "src_folders" : ["test/nightwatch"], + "src_folders" : ["test/nightwatch"], + "globals": "test/nightwatch/globals.js", - "test_settings" : { - "default" : { - "silent": true, - "screenshots" : { - "enabled" : false, - "path" : "" - }, - "desiredCapabilities": { - "browserName": "phantomjs", - "javascriptEnabled" : true - } - } - } + "test_settings" : { + "default" : { + "silent": true, + "exclude": "globals.js", + "screenshots" : { + "enabled" : false, + "path" : "" + }, + "desiredCapabilities": { + "browserName": "phantomjs", + "javascriptEnabled" : true + } + } + } } diff --git a/test/nightwatch/globals.js b/test/nightwatch/globals.js new file mode 100644 index 0000000..998dfe1 --- /dev/null +++ b/test/nightwatch/globals.js @@ -0,0 +1,7 @@ +module.exports = { + before : function(cb) { + console.log("Requiring fetch polyfill"); + require('whatwg-fetch'); + cb(); + } +};