Skip to content

Instantly share code, notes, and snippets.

@cohama
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cohama/5c72a6ce8bf775a23e07 to your computer and use it in GitHub Desktop.
Save cohama/5c72a6ce8bf775a23e07 to your computer and use it in GitHub Desktop.
var assert = require('assert');
describe('hoge', function() {
beforeEach(function() {
this.foo = 1;
this.bar = 5;
THIS = this;
});
it('first', function() {
assert.equal(1, this.foo);
});
describe('child scope', function() {
beforeEach(function() {
this.foo = 5;
});
it('first child', function() {
assert.equal(this.bar, this.foo);
});
it('is prototype', function() {
assert.equal(THIS, this.__proto__);
});
});
describe('child scope 2', function() {
it('last child', function() {
assert.equal(1, this.foo);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment