diff --git a/docs/rules/prefer-toHaveBeenCalledWith.md b/docs/rules/prefer-toHaveBeenCalledWith.md index 16e9f40..e42e553 100644 --- a/docs/rules/prefer-toHaveBeenCalledWith.md +++ b/docs/rules/prefer-toHaveBeenCalledWith.md @@ -30,6 +30,15 @@ describe("", function() { }); ``` +```js +describe("", function() { + it("", function() { + f(); + expect(f).toHaveBeenCalledWith(); + }); +}); +``` + ```js describe("", function() { it("", function() { diff --git a/test/rules/prefer-toHaveBeenCalledWith.js b/test/rules/prefer-toHaveBeenCalledWith.js index 9e060e4..de4c3ec 100644 --- a/test/rules/prefer-toHaveBeenCalledWith.js +++ b/test/rules/prefer-toHaveBeenCalledWith.js @@ -17,6 +17,15 @@ eslintTester.run('prefer toHaveBeenCalledWith', rule, { ' });', '});' ]), + linesToCode([ + 'describe("", function() {', + ' it("", function(){', + '', + ' f();', + ' expect(f).toHaveBeenCalledWith()', + ' });', + '});' + ]), linesToCode([ 'describe("", function() {', ' it("", function(){',