Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/sdk/test/unit/customMatchers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { StreamrClientError } from '../../src/StreamrClientError'

const ESCAPED_ANSI_COLOR_REGEXP = '(\\x1B\\[\\d+m)?'

describe('custom matchers', () => {

describe('toThrowStreamrClientError', () => {
Expand Down Expand Up @@ -35,7 +37,8 @@ describe('custom matchers', () => {
message: 'Foobar',
code: 'UNSUPPORTED_OPERATION'
})
}).toThrow('Not an instance of StreamrClientError:\nReceived: "TestClass"')
// eslint-disable-next-line max-len
}).toThrow(new RegExp(`Not an instance of StreamrClientError:\nReceived: ${ESCAPED_ANSI_COLOR_REGEXP}"TestClass"${ESCAPED_ANSI_COLOR_REGEXP}`))
})

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

it('inverse', () => {
Expand Down
Loading