Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
Last active March 19, 2020 05:54
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 PurpleBooth/447232258bcb24b94dc23bb0bf25a890 to your computer and use it in GitHub Desktop.
Save PurpleBooth/447232258bcb24b94dc23bb0bf25a890 to your computer and use it in GitHub Desktop.
// Create an object with hollow methods (does not need to implement everything)
const myTestDouble = {
exampleMethod: (): any => {
}
} as RealClass;
// Then to return something
spyOn(myTestDouble, 'exampleMethod').and.returnValue("Stubbed Value");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment