From 3ee5b80e133895ddbca14d5ff997900873cb9c90 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 30 Oct 2023 02:34:08 +0800 Subject: [PATCH] fix test --- tests/unit/test.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/unit/test.js b/tests/unit/test.js index cf4e5429..422fe893 100644 --- a/tests/unit/test.js +++ b/tests/unit/test.js @@ -1177,11 +1177,13 @@ describe('Client', function () { describe('putObjectRetention(bucket, objectName, retentionConfig, callback)', () => { it('should fail on null bucket', (done) => { - try { - client.putObjectRetention(null, '', {}, function () {}) - } catch (e) { - done() - } + client.putObjectRetention(null, '', {}, function (err) { + if (err) { + done() + } else { + done(new Error('expecting error')) + } + }) }) it('should fail on empty bucket', (done) => { client.putObjectRetention('', '', {}, function (err) {