diff --git a/src/dev/i18n/__snapshots__/utils.test.js.snap b/src/dev/i18n/__snapshots__/utils.test.js.snap index 85e61058072b1b..2a2f196d3f13f3 100644 --- a/src/dev/i18n/__snapshots__/utils.test.js.snap +++ b/src/dev/i18n/__snapshots__/utils.test.js.snap @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`i18n utils should escape linebreaks 1`] = `"Text with\\\\n\\\\n\\\\nline-breaks and \\\\n\\\\n\\\\n \\\\n\\\\n\\\\n "`; +exports[`i18n utils should not escape linebreaks 1`] = ` +"Text + with + line-breaks +" +`; diff --git a/src/dev/i18n/utils.js b/src/dev/i18n/utils.js index af01c4721f14ad..658c1cbe671774 100644 --- a/src/dev/i18n/utils.js +++ b/src/dev/i18n/utils.js @@ -30,7 +30,6 @@ import { promisify } from 'util'; const ESCAPE_LINE_BREAK_REGEX = /(? { test('should remove escaped linebreak', () => { expect(formatJSString('Test\\\n str\\\ning')).toEqual('Test string'); }); - - test('should escape linebreaks', () => { + test('should not escape linebreaks', () => { expect( - formatJSString(`Text with - - -line-breaks and \n\n - \n\n - `) + formatJSString(`Text \n with + line-breaks +`) ).toMatchSnapshot(); }); - test('should detect i18n translate function call', () => { let source = i18nTranslateSources[0]; let expressionStatementNode = [...traverseNodes(parse(source).program.body)].find(node =>