From dcbf2b3edd427b7d85c8e60802dbb0bf6526a9c2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 25 May 2023 23:18:35 +0000 Subject: [PATCH] Add a test to check #42. --- src/executor.spec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/executor.spec.ts b/src/executor.spec.ts index fce53c7..11281d2 100644 --- a/src/executor.spec.ts +++ b/src/executor.spec.ts @@ -424,6 +424,15 @@ describe("execute", () => { expect(await ex.execute(`let b = {}.constructor === Object`)).toBe(true); expect(ex.locals.b).toEqual(true); }); + + it("check bug#42", async () => { + // Checks if https://github.com/yunabe/tslab/issues/42 is reproducible in CI. + expect( + await ex.execute(`let person = new Object(); person['name'] = 'yunabe';`) + ).toBe(true); + expect(consoleErrorCalls).toEqual([]); + expect(ex.locals.person).toEqual({ name: "yunabe" }); + }); }); describe("interrupt", () => {