diff --git a/spec/helpers/BrowserFlags.js b/spec/helpers/BrowserFlags.js index ef8d607f..c8300b62 100644 --- a/spec/helpers/BrowserFlags.js +++ b/spec/helpers/BrowserFlags.js @@ -20,23 +20,4 @@ return /Firefox\/([0-9]{0,})/.exec(userAgent); }); - function hasFunctioningSets() { - if (typeof Set !== 'undefined') { return false; } - - try { - var s = new Set([4]); - if (s.size !== 1) { return false; } - if (s.values().next().value !== 4) { return false; } - return true; - } catch(e) { - return false; - } - } - - env.requireFunctioningSets = function() { - if (!hasFunctioningSets()) { - pending("Browser has incomplete or missing support for Sets"); - } - }; - })(jasmine.getEnv()); diff --git a/spec/helpers/checkForSet.js b/spec/helpers/checkForSet.js new file mode 100644 index 00000000..6856a0e3 --- /dev/null +++ b/spec/helpers/checkForSet.js @@ -0,0 +1,21 @@ +(function(env) { + function hasFunctioningSets() { + if (typeof Set === 'undefined') { return false; } + + try { + var s = new Set([4]); + if (s.size !== 1) { return false; } + if (s.values().next().value !== 4) { return false; } + return true; + } catch(e) { + return false; + } + } + + env.requireFunctioningSets = function() { + if (!hasFunctioningSets()) { + pending("Browser has incomplete or missing support for Sets"); + } + }; + +})(jasmine.getEnv()); diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json index 546116c7..83b19dbb 100644 --- a/spec/support/jasmine.json +++ b/spec/support/jasmine.json @@ -6,6 +6,7 @@ "npmPackage/**/*.js" ], "helpers": [ + "helpers/checkForSet.js", "helpers/nodeDefineJasmineUnderTest.js" ], "random": true diff --git a/spec/support/jasmine.yml b/spec/support/jasmine.yml index f126b151..da959031 100644 --- a/spec/support/jasmine.yml +++ b/spec/support/jasmine.yml @@ -17,6 +17,7 @@ src_files: stylesheets: helpers: - 'helpers/BrowserFlags.js' + - 'helpers/checkForSet.js' - 'helpers/defineJasmineUnderTest.js' spec_files: - '**/*[Ss]pec.js'