From 80bb8cd9d6b2b3a4dd03b97682b05e5ca871c1f7 Mon Sep 17 00:00:00 2001 From: Diana Suvorova Date: Sat, 22 Jul 2017 14:42:11 -0700 Subject: [PATCH] feat: toHaveBeenCalledWith without args --- docs/rules/prefer-toHaveBeenCalledWith.md | 9 +++++++++ test/rules/prefer-toHaveBeenCalledWith.js | 9 +++++++++ 2 files changed, 18 insertions(+) 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(){',