Last active
January 15, 2019 00:49
-
-
Save ZackDeRose/cab879c2b521c5e7f45b28000cf03483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Foo Class', () => { | |
describe('constructor', () => { | |
const fooClassRef = Foo as any; // to pass typechecking | |
beforeEach(() => { | |
console.log(`start of beforeEach: ${fooClassRef._count}`); | |
fooClassRef._count = 0; | |
console.log(`end of beforeEach: ${fooClassRef._count}`); | |
}); | |
describe('creating one Foo obj', () => { | |
console.log(fooClassRef._count); | |
const foo = new Foo(); | |
it('should have an id of 1', () => { | |
expect(foo.id).toBe(1); | |
}); | |
}); | |
describe('creating two Foo objs', () => { | |
console.log(fooClassRef._count); | |
const foo1 = new Foo(); | |
const foo2 = new Foo(); | |
it('should have ids of 1 and 2', () => { | |
expect(foo1.id).toBe(1); | |
expect(foo2.id).toBe(2); | |
}); | |
}); | |
}); | |
}); |
👍
Updated. Ty!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A little white space goes a long way. At least, it makes it clearer to me where you went wrong. It took a moment to notice.