mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Restructure assertion for friendlier errors
This commit is contained in:
parent
d31e490978
commit
58382da825
1 changed files with 4 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ describe('trimReport', () => {
|
|||
const trimmed = trimReport(MAX_LEN_REPORT, 0, DEFAULT_OPTIONS)
|
||||
const trimmedLength = getByteLength(trimmed)
|
||||
|
||||
expect(trimmed).toMatch(/has been trimmed\*\*$/)
|
||||
expect(trimmed.endsWith('has been trimmed**')).toBe(true) // assert was trimmed
|
||||
expectToBeWithinRangeOfCeiling(trimmedLength, MAX_ACTIONS_SUMMARY_LENGTH - ALWAYS_RESERVED_SPACE, TEST_LINE_LEN)
|
||||
})
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ describe('trimReport', () => {
|
|||
const trimmed = trimReport(MAX_LEN_REPORT, prependStringLen, DEFAULT_OPTIONS)
|
||||
const trimmedLength = getByteLength(trimmed)
|
||||
|
||||
expect(trimmed).toMatch(/has been trimmed\*\*$/)
|
||||
expect(trimmed.endsWith('has been trimmed**')).toBe(true) // assert was trimmed
|
||||
expectToBeWithinRangeOfCeiling(
|
||||
trimmedLength,
|
||||
MAX_ACTIONS_SUMMARY_LENGTH - ALWAYS_RESERVED_SPACE - prependStringLen,
|
||||
|
|
@ -55,7 +55,7 @@ describe('getReport', () => {
|
|||
const trimmed = getReport(MAX_LEN_RESULT, DEFAULT_OPTIONS)
|
||||
const trimmedLength = getByteLength(trimmed)
|
||||
|
||||
expect(trimmed).toMatch(/has been trimmed\*\*$/)
|
||||
expect(trimmed.endsWith('has been trimmed**')).toBe(true) // assert was trimmed
|
||||
expectToBeWithinRangeOfCeiling(trimmedLength, MAX_ACTIONS_SUMMARY_LENGTH - ALWAYS_RESERVED_SPACE, FAILURE_ROW_LEN)
|
||||
})
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ describe('getReport', () => {
|
|||
const trimmed = getReport(MAX_LEN_RESULT, DEFAULT_OPTIONS, prependString)
|
||||
const trimmedLength = getByteLength(trimmed)
|
||||
|
||||
expect(trimmed).toMatch(/has been trimmed\*\*$/)
|
||||
expect(trimmed.endsWith('has been trimmed**')).toBe(true) // assert was trimmed
|
||||
expectToBeWithinRangeOfCeiling(
|
||||
trimmedLength,
|
||||
MAX_ACTIONS_SUMMARY_LENGTH - ALWAYS_RESERVED_SPACE - prependStringLen,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue