From 510b82eab7d4180ff5dd6f40e66f50933bafa6d8 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Fri, 15 Dec 2023 21:54:16 +0000 Subject: [PATCH] Tests WIP 3 --- test/with.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/with.test.js b/test/with.test.js index 378d4113..afaa9670 100644 --- a/test/with.test.js +++ b/test/with.test.js @@ -494,6 +494,23 @@ describe('with statements', () => { expect(transpiled.split('\n')[0]).toInclude('let livepack_temp_20;'); } }); + + itSerializes('`livepack_getFnInfo`', { + in: ` + with ({livepack_getFnInfo_5: 1, livepack_getFnInfo_0: 2}) { + module.exports = () => 123; + } + `, + out: '()=>123', + validate(fn, {transpiled}) { + expect(fn).toBeFunction(); + expect(fn()).toBe(123); + + // Check internal functions match the ones being tested for + expect(transpiled).toInclude('function livepack_getFnInfo_5() {'); + expect(transpiled).toInclude('function livepack_getFnInfo_0() {'); + } + }); }); }); });