From 41e3655c4ed9074771ef4ffa8762179297d78306 Mon Sep 17 00:00:00 2001 From: Flacial Date: Sat, 8 Oct 2022 14:56:02 +0400 Subject: [PATCH] test: Correct dynamicMessages assertions result --- src/util/dynamicMessages.test.js | 4 ++-- src/util/dynamicMessages.ts | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/util/dynamicMessages.test.js b/src/util/dynamicMessages.test.js index cbaa7a9..f4e6157 100644 --- a/src/util/dynamicMessages.test.js +++ b/src/util/dynamicMessages.test.js @@ -4,13 +4,13 @@ import { bold } from 'chalk' describe('Dynamic messages', () => { it('Should add string to INVALID_SECOND_FILE', () => { expect(INVALID_SECOND_FILE('abc.js')).toEqual( - bold.red("Invalid second file (abc.js) to be submitted. Please make sure you are submitting a valid test file (abc.test.js) if it is supposed to be a test file, else remove it and submit") + bold.red("Invalid second file (abc.js) to be submitted. Please make sure you are submitting a valid test file (abc.test.js) if it is supposed to be a test file.\nIf it's supposed to be the HTML script file, please include it in the HTML file.") ) }) it('Should remove parent dir and add string to INVALID_SECOND_FILE', () => { expect(INVALID_SECOND_FILE('abc')).toEqual( - bold.red("Invalid second file (abc) to be submitted. Please make sure you are submitting a valid test file (abc.test.js) if it is supposed to be a test file, else remove it and submit") + bold.red("Invalid second file (abc) to be submitted. Please make sure you are submitting a valid test file (abc.test.js) if it is supposed to be a test file.\nIf it's supposed to be the HTML script file, please include it in the HTML file.") ) }) }) \ No newline at end of file diff --git a/src/util/dynamicMessages.ts b/src/util/dynamicMessages.ts index af23251..b020a21 100644 --- a/src/util/dynamicMessages.ts +++ b/src/util/dynamicMessages.ts @@ -9,10 +9,7 @@ export const INVALID_SECOND_FILE = (invalidFile?: string): string => `(${ invalidFile.includes('.') ? invalidFile.split('.')[0] : invalidFile }.test.js)` - } if it is supposed to be a test file. - - If it's supposed to be the HTML script file, please include it in the HTML file. - ` + } if it is supposed to be a test file.\nIf it's supposed to be the HTML script file, please include it in the HTML file.` ) export const WRONG_CHALLENGE_TO_SUBMIT = (