diff --git a/lib/frameworks/jasmine.js b/lib/frameworks/jasmine.js index 821c12028..7800b7964 100644 --- a/lib/frameworks/jasmine.js +++ b/lib/frameworks/jasmine.js @@ -73,13 +73,15 @@ exports.run = async function(runner, specs) { // work well with e2e tests where the browser state is determined by the // order of the tests. Setting to false will prevent random execution. // See https://jasmine.github.io/api/3.3/Env.html + jasmine.getEnv().configuration().random = false; jasmine.getEnv().randomizeTests(false); + jasmineNodeOpts.random = false; // Add hooks for afterEach require('./setupAfterEach').setup(runner, specs); // Filter specs to run based on jasmineNodeOpts.grep and jasmineNodeOpts.invert. - jasmine.getEnv().specFilter = function(spec) { + jasmine.getEnv().configuration().specFilter = function(spec) { var grepMatch = !jasmineNodeOpts || !jasmineNodeOpts.grep || spec.getFullName().match(new RegExp(jasmineNodeOpts.grep)) != null; @@ -90,15 +92,7 @@ exports.run = async function(runner, specs) { return true; }; - // Run specs in semi-random order - if (jasmineNodeOpts.random) { - jasmine.getEnv().randomizeTests(true); - - // Sets the randomization seed if randomization is turned on - if (jasmineNodeOpts.seed) { - jasmine.getEnv().seed(jasmineNodeOpts.seed); - } - } + await runner.runTestPreparer(); return new Promise((resolve, reject) => {