From 7d58b5331a8006bbf6444231b90e4802ab42451f Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Thu, 12 Aug 2021 14:59:47 +0200 Subject: [PATCH] fix(techdocs-common): adjust azure storage test Signed-off-by: Camila Belo --- .../src/stages/publish/azureBlobStorage.test.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/techdocs-common/src/stages/publish/azureBlobStorage.test.ts b/packages/techdocs-common/src/stages/publish/azureBlobStorage.test.ts index 2e17b43b62..94f960986c 100644 --- a/packages/techdocs-common/src/stages/publish/azureBlobStorage.test.ts +++ b/packages/techdocs-common/src/stages/publish/azureBlobStorage.test.ts @@ -175,12 +175,15 @@ describe('publishing with valid credentials', () => { directory: wrongPathToGeneratedDirectory, }); - await expect(fails).rejects.toThrow( - /Unable to upload file\(s\) to Azure. Error: Failed to read template directory: ENOENT, no such file or directory/, - ); - await expect(fails).rejects.toThrow( - new RegExp(wrongPathToGeneratedDirectory), - ); + await expect(fails).rejects.toMatchObject({ + message: expect.stringContaining( + 'Unable to upload file(s) to Azure. Error: Failed to read template directory: ENOENT, no such file or directory', + ), + }); + + await expect(fails).rejects.toMatchObject({ + message: expect.stringContaining(wrongPathToGeneratedDirectory), + }); }); it('reports an error when bad account credentials', async () => {