From 7f9299d02e7441d303d07cfbd4ee3e806c349c65 Mon Sep 17 00:00:00 2001 From: Aaron Abramov Date: Mon, 9 Jul 2018 14:08:15 -0700 Subject: [PATCH] codemod jasmine -> jest in html/shared Summary: replace `spyOn` with `jest.spyOn` Reviewed By: captbaritone Differential Revision: D8211248 fbshipit-source-id: 7f23ae117c5cc8176bc4ff9f064ea65b03ffb62c --- .../contents/__tests__/DraftEditorTextNode-test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/component/contents/__tests__/DraftEditorTextNode-test.js b/src/component/contents/__tests__/DraftEditorTextNode-test.js index 714d2fa3fe..65126258ed 100644 --- a/src/component/contents/__tests__/DraftEditorTextNode-test.js +++ b/src/component/contents/__tests__/DraftEditorTextNode-test.js @@ -139,16 +139,16 @@ test('must skip updates if text already matches DOM, non-IE', function() { {TEST_A}, ); - spyOn(stub, 'render').and.callThrough(); + jest.spyOn(stub, 'render'); renderIntoContainer({TEST_A}); - expect(stub.render.calls.count()).toBe(0); + expect(stub.render.mock.calls.length).toBe(0); // Sanity check that updating is performed when appropriate. renderIntoContainer({TEST_B}); - expect(stub.render.calls.count()).toBe(1); + expect(stub.render.mock.calls.length).toBe(1); }); test('must skip updates if text already matches DOM, IE', function() { @@ -157,16 +157,16 @@ test('must skip updates if text already matches DOM, IE', function() { {TEST_A}, ); - spyOn(stub, 'render').and.callThrough(); + jest.spyOn(stub, 'render'); renderIntoContainer({TEST_A}); - expect(stub.render.calls.count()).toBe(0); + expect(stub.render.mock.calls.length).toBe(0); // Sanity check that updating is performed when appropriate. renderIntoContainer({TEST_B}); - expect(stub.render.calls.count()).toBe(1); + expect(stub.render.mock.calls.length).toBe(1); }); test('must update from non-empty to empty, non-IE', function() {