From 8b39ef82fa2823ff5daa8c9c2c48d4a2d641185a Mon Sep 17 00:00:00 2001 From: MichaelRedM Date: Mon, 2 Mar 2020 13:08:27 +0100 Subject: [PATCH] feat(jasmine): add support for stopOnSpecFailure option --- lib/config.ts | 4 ++++ lib/frameworks/jasmine.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/config.ts b/lib/config.ts index c04849088..9a3b4a52f 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -648,6 +648,10 @@ export interface Config { * Set the randomization seed if randomization is turned on */ seed?: string, + /** + * Enables failFast option in jasmine, which stops the execution of the suite whether the first spec is failed. + */ + stopOnSpecFailure?: boolean, }; /** diff --git a/lib/frameworks/jasmine.js b/lib/frameworks/jasmine.js index 821c12028..1e62598cf 100644 --- a/lib/frameworks/jasmine.js +++ b/lib/frameworks/jasmine.js @@ -100,6 +100,10 @@ exports.run = async function(runner, specs) { } } + if (jasmineNodeOpts.stopOnSpecFailure) { + jasmine.getEnv().stopOnSpecFailure(jasmineNodeOpts.stopOnSpecFailure); + } + await runner.runTestPreparer(); return new Promise((resolve, reject) => { if (jasmineNodeOpts && jasmineNodeOpts.defaultTimeoutInterval) {