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) {