diff --git a/__tests__/plugins/any-of.test.js b/__tests__/plugins/any-of.test.js index e69419d..ac5650b 100644 --- a/__tests__/plugins/any-of.test.js +++ b/__tests__/plugins/any-of.test.js @@ -109,7 +109,11 @@ describe("plugin: any-of", () => { try { await self.LibResilientPlugins[0].fetch('https://resilient.is/test.json') } catch (e) { - expect(e[0].toString()).toMatch('Error') + if (e instanceof Array) { + expect(e[0].toString()).toMatch('Error') + } else { + expect(e).toBeInstanceOf(AggregateError) + } } expect(fetch).toHaveBeenCalled(); });