Skip to content

Commit

Permalink
fix(middleware): read bail value from the util module
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Apr 1, 2017
1 parent 6ce1d59 commit f24d2d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Group.js
Expand Up @@ -20,15 +20,14 @@ class Group {
constructor (title, isRoot) {
this._title = title
this._isRoot = !!isRoot
this._timeout = $.getTimeout()
this._hooks = {
beforeEach: [],
afterEach: [],
before: [],
after: []
}
this._tests = []
this.middleware = new Middleware(this, $.getBail(), this._wrapFn)
this.middleware = new Middleware(this, this._wrapFn)
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/Middleware.js
Expand Up @@ -9,11 +9,13 @@
* file that was distributed with this source code.
*/

const $ = require('../lib/util')

class Middleware {

constructor (context, bail, fnWrapper) {
constructor (context, fnWrapper) {
this._context = context
this._bail = !!bail
this._bail = $.getBail()
this._fnWrapper = fnWrapper
this._stack = []
this.errorsStack = []
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.js
Expand Up @@ -225,7 +225,7 @@ class Runner {
}

return new Promise((resolve, reject) => {
const middleware = new Middleware(this, $.getBail(), this._wrapFn)
const middleware = new Middleware(this, this._wrapFn)
this._start()
middleware.compose(this._testGroups)()
.then(() => {
Expand Down

0 comments on commit f24d2d7

Please sign in to comment.