Skip to content

Instantly share code, notes, and snippets.

@qunabu
Created November 26, 2020 10:31
Show Gist options
  • Save qunabu/513cdcfd24608018820a9e07f788d955 to your computer and use it in GitHub Desktop.
Save qunabu/513cdcfd24608018820a9e07f788d955 to your computer and use it in GitHub Desktop.
it("should call a method with the proper arguments", () => {
const foo = {
bar: jasmine.createSpy(),
baz: jasmine.createSpy(),
};
foo.bar("qux");
expect(foo.bar).toHaveBeenCalled();
expect(foo.bar.calls.argsFor(0)).toEqual(["qux"]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment