allure-jasmine
Advanced tools
Comparing version 2.0.0-beta.24 to 2.0.0-beta.25
@@ -178,14 +178,19 @@ "use strict"; | ||
installHooks() { | ||
const reporter = this; | ||
const jasmineBeforeAll = eval("global.beforeAll"); | ||
const jasmineAfterAll = eval("global.afterAll"); | ||
const jasmineBeforeEach = eval("global.beforeEach"); | ||
const jasmineAfterEach = eval("global.afterEach"); | ||
const jasmineBeforeAll = global.beforeAll; | ||
const jasmineAfterAll = global.afterAll; | ||
const jasmineBeforeEach = global.beforeEach; | ||
const jasmineAfterEach = global.afterEach; | ||
const makeWrapperAll = (wrapped, fun) => { | ||
return (action, timeout) => { | ||
try { | ||
this.runningExecutable = fun(); | ||
} | ||
catch (_a) { | ||
wrapped(action, timeout); | ||
return; | ||
} | ||
wrapped((done) => { | ||
reporter.runningExecutable = fun(); | ||
let ret; | ||
if (action.length > 0) { | ||
ret = reporter.runningExecutable.wrap(() => new Promise((resolve, reject) => { | ||
ret = this.runningExecutable.wrap(() => new Promise((resolve, reject) => { | ||
const t = resolve; | ||
@@ -197,3 +202,3 @@ t.fail = reject; | ||
else { | ||
ret = reporter.runningExecutable.wrap(action)(); | ||
ret = this.runningExecutable.wrap(action)(); | ||
} | ||
@@ -203,7 +208,7 @@ if ((0, allure_js_commons_1.isPromise)(ret)) { | ||
.then(() => { | ||
reporter.runningExecutable = null; | ||
this.runningExecutable = null; | ||
done(); | ||
}) | ||
.catch((e) => { | ||
reporter.runningExecutable = null; | ||
this.runningExecutable = null; | ||
done.fail(e); | ||
@@ -213,3 +218,3 @@ }); | ||
else { | ||
reporter.runningExecutable = null; | ||
this.runningExecutable = null; | ||
done(); | ||
@@ -220,10 +225,18 @@ } | ||
}; | ||
const wrapperBeforeAll = makeWrapperAll(jasmineBeforeAll, () => reporter.currentGroup.addBefore()); | ||
const wrapperAfterAll = makeWrapperAll(jasmineAfterAll, () => reporter.currentGroup.addAfter()); | ||
const wrapperBeforeEach = makeWrapperAll(jasmineBeforeEach, () => reporter.currentGroup.addBefore()); | ||
const wrapperAfterEach = makeWrapperAll(jasmineAfterEach, () => reporter.currentGroup.addAfter()); | ||
eval("global.beforeAll = wrapperBeforeAll;"); | ||
eval("global.afterAll = wrapperAfterAll;"); | ||
eval("global.beforeEach = wrapperBeforeEach;"); | ||
eval("global.afterEach = wrapperAfterEach;"); | ||
const wrapperBeforeAll = makeWrapperAll(jasmineBeforeAll, () => { | ||
return this.currentGroup.addBefore(); | ||
}); | ||
const wrapperAfterAll = makeWrapperAll(jasmineAfterAll, () => { | ||
return this.currentGroup.addAfter(); | ||
}); | ||
const wrapperBeforeEach = makeWrapperAll(jasmineBeforeEach, () => { | ||
return this.currentGroup.addBefore(); | ||
}); | ||
const wrapperAfterEach = makeWrapperAll(jasmineAfterEach, () => { | ||
return this.currentGroup.addAfter(); | ||
}); | ||
global.beforeAll = wrapperBeforeAll; | ||
global.afterAll = wrapperAfterAll; | ||
global.beforeEach = wrapperBeforeEach; | ||
global.afterEach = wrapperAfterEach; | ||
} | ||
@@ -230,0 +243,0 @@ } |
{ | ||
"name": "allure-jasmine", | ||
"version": "2.0.0-beta.24", | ||
"version": "2.0.0-beta.25", | ||
"description": "Allure Jasmine integration", | ||
@@ -31,3 +31,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"allure-js-commons": "2.0.0-beta.24" | ||
"allure-js-commons": "2.0.0-beta.25" | ||
}, | ||
@@ -34,0 +34,0 @@ "nyc": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
40525
418
0
+ Addedallure-js-commons@2.0.0-beta.25(transitive)
- Removedallure-js-commons@2.0.0-beta.24(transitive)