File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11import { StreamrClientError } from '../../src/StreamrClientError'
22
3+ const ESCAPED_ANSI_COLOR_REGEXP = '(\\x1B\\[\\d+m)?'
4+
35describe ( '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' , ( ) => {
You can’t perform that action at this time.
0 commit comments