From 3cce85641ef967e25c5f19792f7a21168066de5a Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Thu, 28 Mar 2024 16:26:15 +0100 Subject: [PATCH] Simplify assertions to handle Node version difference --- node-src/lib/getConfiguration.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node-src/lib/getConfiguration.test.ts b/node-src/lib/getConfiguration.test.ts index 178c2a7a9..619c4d9fd 100644 --- a/node-src/lib/getConfiguration.test.ts +++ b/node-src/lib/getConfiguration.test.ts @@ -156,19 +156,19 @@ it('errors if config file is unparseable', async () => { { mockedReadFile.mockReturnValue('invalid json'); await expect(getConfiguration('test.file')).rejects.toThrow( - /Configuration file .+ could not be parsed(.|\n)*Unexpected token i in JSON/ + /Configuration file .+ could not be parsed(.|\n)*Unexpected token/ ); } { mockedReadFile.mockReturnValue('{ "foo": 1 "unexpectedString": 2 }'); await expect(getConfiguration('test.file')).rejects.toThrow( - /Configuration file .+ could not be parsed(.|\n)*Unexpected string in JSON/m + /Configuration file .+ could not be parsed(.|\n)*Unexpected string/m ); } { mockedReadFile.mockReturnValue('{ "unexpectedEnd": '); await expect(getConfiguration('test.file')).rejects.toThrow( - /Configuration file .+ could not be parsed(.|\n)*Unexpected end of JSON input/m + /Configuration file .+ could not be parsed(.|\n)*Unexpected end/m ); } });