From 748342cb881fd17e63dfaabe71363dc7b4c1f5f0 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 22 Jul 2024 12:21:43 -0500 Subject: [PATCH] test: empty object for wrap --- test/unit/sfErrorTest.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unit/sfErrorTest.ts b/test/unit/sfErrorTest.ts index eb7a39e2c..ae0576d5e 100644 --- a/test/unit/sfErrorTest.ts +++ b/test/unit/sfErrorTest.ts @@ -205,6 +205,13 @@ describe('SfError', () => { assert(mySfError.cause instanceof Error); expect(mySfError.cause.cause).to.equal(wrapMe); }); + it('empty object', () => { + const wrapMe = {}; + const mySfError = SfError.wrap(wrapMe); + expect(mySfError).to.be.an.instanceOf(SfError); + assert(mySfError.cause instanceof Error); + expect(mySfError.cause.cause).to.equal(wrapMe); + }); it('an object that has a code', () => { const wrapMe = { a: 2, code: 'foo' }; const mySfError = SfError.wrap(wrapMe);