summaryrefslogtreecommitdiffstats
path: root/frontend/jest.setup.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/jest.setup.js')
-rw-r--r--frontend/jest.setup.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/frontend/jest.setup.js b/frontend/jest.setup.js
index 82edfc9..1783f17 100644
--- a/frontend/jest.setup.js
+++ b/frontend/jest.setup.js
@@ -2,3 +2,16 @@ import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
+
+expect.extend({
+ toBeCalledWithVariables(received, argument) {
+ const receivedVariables = received.mock.calls[0][0].variables;
+ const pass = this.equals(receivedVariables, argument);
+ const message = () =>
+ `expected ${this.utils.printExpected(argument)} to match ${this.utils.printReceived(
+ receivedVariables
+ )}`;
+
+ return { message, pass };
+ },
+});