From 1b62ecb7fa98fcb041462f239c5a863eaab2de2b Mon Sep 17 00:00:00 2001 From: Patrik Meijer Date: Fri, 3 May 2024 14:05:28 -0400 Subject: [PATCH] Fix test wrt to error message --- test/bin/blob_fs_clean_up.spec.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/bin/blob_fs_clean_up.spec.js b/test/bin/blob_fs_clean_up.spec.js index b9be8bfb3..95cf20373 100644 --- a/test/bin/blob_fs_clean_up.spec.js +++ b/test/bin/blob_fs_clean_up.spec.js @@ -65,9 +65,15 @@ describe('BLOB cleanup script tests', function () { done(new Error('missing error handling')); }) .catch(function (err) { - expect(err.message).to.contains('Unexpected token o'); + try { + expect(err.message).to.contains('Unexpected token'); + done(); + } catch (err) { + done(err); + } + }) + .finally(()=> { FS.unlinkSync('test-tmp/not.json'); - done(); }) .done(); }); @@ -80,9 +86,15 @@ describe('BLOB cleanup script tests', function () { done(new Error('missing error handling')); }) .catch(function (err) { - expect(err.message).to.contains('no such file or directory, unlink'); + try { + expect(err.message).to.contains('no such file or directory, unlink'); + done(); + } catch (err) { + done(err); + } + }) + .finally(()=> { FS.unlinkSync('test-tmp/wrongHashes.json'); - done(); }) .done(); });