Skip to content

Commit

Permalink
test: Correct dynamicMessages assertions result
Browse files Browse the repository at this point in the history
  • Loading branch information
flacial committed Oct 8, 2022
1 parent 3e10e3b commit 41e3655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/util/dynamicMessages.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
)
})
})
5 changes: 1 addition & 4 deletions src/util/dynamicMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit 41e3655

Please sign in to comment.