Skip to content

Instantly share code, notes, and snippets.

@enricopolanski
Last active June 22, 2018 16:53
Show Gist options
  • Save enricopolanski/3810c0789c9196c4876487bbf73aa0f8 to your computer and use it in GitHub Desktop.
Save enricopolanski/3810c0789c9196c4876487bbf73aa0f8 to your computer and use it in GitHub Desktop.
import StudiesObserver from './StudiesObserver';
beforeEach(()=> {
const studiesObserver = new StudiesObserver();
});
test('Changing the StudyBlock.status property should trigger update()', () => {
const spy = jest.spyOn(studiesObserver, 'update');
const isUpdating = studiesObserver.update();
expect(spy).toHaveBeenCalled();
})
/* Jest error:
ReferenceError: studiesObserver is not defined
const spy = jest.spyOn(studiesObserver, 'update');
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment