Skip to content

Instantly share code, notes, and snippets.

@tomasperezv
Created November 13, 2016 10:29
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 tomasperezv/631b8c898396a0df5a9782894e0229d8 to your computer and use it in GitHub Desktop.
Save tomasperezv/631b8c898396a0df5a9782894e0229d8 to your computer and use it in GitHub Desktop.
const originalObject = {
testMethod: () => {}
};
it('#spy intercepts property gets', () => {
const spy = new Spy();
const mock = spy.watch(originalObject);
const triggerSetAccess = mock.test;
assert.equal(spy.get('test').called, true);
assert.equal(spy.get('test').count, 1);
assert.equal(spy.get('test').isDefined, true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment