From 7166e60558b251ef5571df48816bce544491bd97 Mon Sep 17 00:00:00 2001 From: Tom <26638278+tomblind@users.noreply.github.com> Date: Sun, 2 Jun 2019 16:14:03 -0600 Subject: [PATCH] removing tstl header from lib functions fixes #610 --- src/lualib/tsconfig.json | 3 ++- test/unit/lualib/lualib.spec.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lualib/tsconfig.json b/src/lualib/tsconfig.json index 350f34824..a9ca1cb4d 100644 --- a/src/lualib/tsconfig.json +++ b/src/lualib/tsconfig.json @@ -11,6 +11,7 @@ }, "tstl": { "luaLibImport": "none", - "luaTarget": "5.1" + "luaTarget": "5.1", + "noHeader": true } } diff --git a/test/unit/lualib/lualib.spec.ts b/test/unit/lualib/lualib.spec.ts index f7f2b5538..7cb051b35 100644 --- a/test/unit/lualib/lualib.spec.ts +++ b/test/unit/lualib/lualib.spec.ts @@ -142,3 +142,11 @@ test("Object.fromEntries (Map)", () => { expect(JSON.parse(result)).toEqual({ foo: "bar" }); }); + +test("lualibs should not include tstl header", () => { + const code = ` + const arr = [1, 2, 3]; + arr.push(4);`; + + expect(util.transpileString(code)).not.toMatch("Generated with"); +});