Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created August 16, 2016 04:57
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 matthieu-D/830b9be280b32f9870a8ff1cfbabed33 to your computer and use it in GitHub Desktop.
Save matthieu-D/830b9be280b32f9870a8ff1cfbabed33 to your computer and use it in GitHub Desktop.
describe('App', () => {
let a;
beforeEach(() => {
//We set or reset a here;
a = 'Apple';
});
it('should be an Apple ', () => {
expect(a).toEqual('Apple');
// We change the value
a = 'Pear';
});
it('should not be a Pear ', () => {
//But it's still an Apple since we reset it in beforeEach
expect(a).toEqual('Apple');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment