Skip to content

Commit

Permalink
Tests WIP 3
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 15, 2023
1 parent 7c90050 commit 510b82e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/with.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {');
}
});
});
});
});

0 comments on commit 510b82e

Please sign in to comment.