Skip to content

Instantly share code, notes, and snippets.

@ryardley
Last active August 29, 2015 14:14
Show Gist options
  • Save ryardley/9b5ef481777f50ffc550 to your computer and use it in GitHub Desktop.
Save ryardley/9b5ef481777f50ffc550 to your computer and use it in GitHub Desktop.
var msg = 'hello world';
function doSomething(){
var msg = 'foo';
function inner(){
return msg;
}
return inner();
}
expect(msg).toEqual('hello world');
expect(doSomething()).toEqual('foo');
msg = 'bar';
expect(doSomething()).toEqual('foo');
expect(msg).toEqual('bar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment