TypeError: Cannot read property 't' of undefined
~/tmp/mocha ɀ cat test/a.js
var assert = require('assert');
beforeEach(function() {
console.log('global each');
this.each = true;
});
describe('a test suite', function() {
var all, each;
before(function() {
all = this;
this.all = true;
console.log('* this.each is ', this.each);
});
beforeEach(function() {
console.log('local each, this.all is ', this.all);
});
it('runs!', function() {
assert(this.each, 'this.each is set')
assert(this.all, 'this.all is set')
});
});
~/tmp/mocha ɀ mocha test/a.js
a test suite
* this.each is undefined
global each
local each, this.all is true
✓ runs!
1 passing (18ms)
~/tmp/mocha ɀ
--
You received this message because you are subscribed to the Google Groups "Mocha" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mochajs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.