diff --git a/test/index.test.ts b/test/index.test.ts index 1ad79cb..7580181 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -77,9 +77,7 @@ it('should throw an error on shorthand identifiers', () => { const result = jsonLoose(input, context) expect(result).toEqual('{"foo"}') - expect(() => JSON.parse(result)).toThrowError( - /Unexpected token } in JSON at position/ - ) + expect(() => JSON.parse(result)).toThrowError() }) it('should throw an error on rest identifiers', () => { @@ -88,9 +86,7 @@ it('should throw an error on rest identifiers', () => { const result = jsonLoose(input, context) expect(result).toEqual('{..."[object Object]"}') - expect(() => JSON.parse(result)).toThrowError( - /Unexpected token . in JSON at position/ - ) + expect(() => JSON.parse(result)).toThrowError() }) it('should throw an error on malformed input', () => {