Skip to content

Commit 5ee274a

Browse files
committed
Added module fix test
1 parent edf1178 commit 5ee274a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/unit/modules.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Expect, Test, TestCase } from "alsatian";
22
import * as ts from "typescript";
3-
import { LuaTarget, LuaTranspiler } from "../../src/Transpiler";
3+
44
import * as util from "../src/util";
55

66
export class LuaModuleTests {
@@ -34,4 +34,13 @@ export class LuaModuleTests {
3434
Expect(() => transpiler.transpileImport(mockDeclaration as ts.ImportDeclaration))
3535
.toThrowError(Error, "Unsupported import type.");
3636
}
37+
38+
@Test("Non-exported module")
39+
public nonExportedModule() {
40+
const lua = util.transpileString("module g { export function test() { return 3; } } return g.test();");
41+
42+
const result = util.executeLua(lua);
43+
44+
Expect(result).toBe(3);
45+
}
3746
}

0 commit comments

Comments
 (0)