From cdd03dd1c59e24423c2bd02a2419841ef73ba205 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Tue, 14 Nov 2017 19:34:47 +0100 Subject: [PATCH] Use toEqual instead of toBe --- test/i18n-test/languageHandler-test.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/i18n-test/languageHandler-test.js b/test/i18n-test/languageHandler-test.js index f3c2e135d5..bdaa431e0a 100644 --- a/test/i18n-test/languageHandler-test.js +++ b/test/i18n-test/languageHandler-test.js @@ -49,15 +49,14 @@ describe('languageHandler', function() { }); it('variable substitution with React component', function() { - // Need an extra space at the end because the result of _t() has an extra empty node at the end - const text = 'You are now ignoring %(userId)s '; - expect(JSON.stringify(languageHandler._t(text, { userId: () => foo }))) - .toBe(JSON.stringify((You are now ignoring foo ))); + const text = 'You are now ignoring %(userId)s'; + expect(languageHandler._t(text, { userId: () => foo })) + .toEqual((You are now ignoring foo)); }); it('tag substitution with React component', function() { const text = 'Press to start a chat with someone'; - expect(JSON.stringify(languageHandler._t(text, {}, { 'StartChatButton': () => foo }))) - .toBe(JSON.stringify(Press foo to start a chat with someone)); + expect(languageHandler._t(text, {}, { 'StartChatButton': () => foo })) + .toEqual(Press foo to start a chat with someone); }); });