Skip to content

Commit a2e75ed

Browse files
committed
allow ansi colors
1 parent 0391523 commit a2e75ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/sdk/test/unit/customMatchers.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { StreamrClientError } from '../../src/StreamrClientError'
22

3+
const ESCAPED_ANSI_COLOR_REGEXP = '(\\x1B\\[\\d+m)?'
4+
35
describe('custom matchers', () => {
46

57
describe('toThrowStreamrClientError', () => {
@@ -35,7 +37,8 @@ describe('custom matchers', () => {
3537
message: 'Foobar',
3638
code: 'UNSUPPORTED_OPERATION'
3739
})
38-
}).toThrow('Not an instance of StreamrClientError:\nReceived: "TestClass"')
40+
// eslint-disable-next-line max-len
41+
}).toThrow(new RegExp(`Not an instance of StreamrClientError:\nReceived: ${ESCAPED_ANSI_COLOR_REGEXP}"TestClass"${ESCAPED_ANSI_COLOR_REGEXP}`))
3942
})
4043

4144
it('unexpected primitive', () => {
@@ -45,7 +48,8 @@ describe('custom matchers', () => {
4548
message: 'Foobar',
4649
code: 'UNSUPPORTED_OPERATION'
4750
})
48-
}).toThrow('Not an instance of StreamrClientError:\nReceived: "mock-error"')
51+
// eslint-disable-next-line max-len
52+
}).toThrow(new RegExp(`Not an instance of StreamrClientError:\nReceived: ${ESCAPED_ANSI_COLOR_REGEXP}"mock-error"${ESCAPED_ANSI_COLOR_REGEXP}`))
4953
})
5054

5155
it('inverse', () => {

0 commit comments

Comments
 (0)