codeceptjs
Advanced tools
Comparing version 0.4.5 to 0.4.6
@@ -0,1 +1,5 @@ | ||
## 0.4.6 | ||
* Added `BeforeSuite` and `AfterSuite` hooks to scenario by @APshenkin. See [updated documentation](http://codecept.io/basics/#beforeSuite) | ||
## 0.4.5 | ||
@@ -2,0 +6,0 @@ |
@@ -38,3 +38,3 @@ /** | ||
}); | ||
suite.on('pre-require', function (context, file, mocha) { | ||
@@ -66,5 +66,16 @@ var common = require('mocha/lib/interfaces/common')(suites, context); | ||
suite.beforeAll('codeceptjs.beforeSuite', scenario.suiteSetup); | ||
suite.afterAll('codeceptjs.afterSuite', scenario.suiteTeardown); | ||
return suite; | ||
}; | ||
context.BeforeSuite = function (fn) { | ||
suites[0].beforeAll('BeforeSuite', scenario.injected(fn)); | ||
}; | ||
context.AfterSuite = function (fn) { | ||
suites[0].afterAll('AfterSuite', scenario.injected(fn)); | ||
}; | ||
context.Background = context.Before = function (fn) { | ||
@@ -71,0 +82,0 @@ suites[0].beforeEach('Before', scenario.injected(fn)); |
@@ -71,3 +71,3 @@ 'use strict'; | ||
module.exports.injected = function (fn) { | ||
return function () { | ||
return function() { | ||
try { | ||
@@ -94,2 +94,12 @@ fn.apply(this, getInjectedArguments(fn)); | ||
module.exports.suiteSetup = function () { | ||
recorder.start(); | ||
event.emit(event.suite.before); | ||
}; | ||
module.exports.suiteTeardown = function () { | ||
recorder.start(); | ||
event.emit(event.suite.after); | ||
}; | ||
function isGenerator(fn) { | ||
@@ -96,0 +106,0 @@ return fn.constructor.name === 'GeneratorFunction'; |
{ | ||
"name": "codeceptjs", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "Modern Era Aceptance Testing Framework for NodeJS", | ||
@@ -5,0 +5,0 @@ "homepage": "http://codecept.io", |
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
200268
5709