From b431df594e64df379e3159320943c94a5636f53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:23:05 +0200 Subject: [PATCH] fix unit test --- src/untrusted/lib/createContext.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/untrusted/lib/createContext.spec.ts b/src/untrusted/lib/createContext.spec.ts index feae8d1..84d7a34 100644 --- a/src/untrusted/lib/createContext.spec.ts +++ b/src/untrusted/lib/createContext.spec.ts @@ -29,7 +29,8 @@ describe('Sandbox Context Creation', () => { const ctx = createContext(allowedGlobals); assert.equal(typeof ctx.Date, 'function'); - assert.equal(ctx.Date, global.Date); + assert.notEqual(ctx.Date, global.Date); + assert.ok(new (ctx.Date as typeof Date)() instanceof global.Date); assert.equal(typeof ctx.parseInt, 'function'); assert.notEqual(ctx.parseInt, global.parseInt); assert.equal(