Skip to content

Commit c438501

Browse files
committed
more tests
1 parent 3f30817 commit c438501

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/unit/modules/resolution.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,21 @@ test("dots in directory names are replaced with underscores in output", () => {
186186
expect(dottedFile!.outPath).not.toContain("Foo.Bar");
187187
});
188188

189+
test("dots in file names are replaced with underscores in output", () => {
190+
const { transpiledFiles } = util.testModule`
191+
import { answer } from "./foo.test";
192+
export const result = answer;
193+
`
194+
.addExtraFile("foo.test.ts", "export const answer = 42;")
195+
.setOptions({ rootDir: "." })
196+
.getLuaResult();
197+
198+
const dottedFile = transpiledFiles.find(f => f.lua?.includes("answer = 42"));
199+
expect(dottedFile).toBeDefined();
200+
expect(dottedFile!.outPath).toContain("foo_test.lua");
201+
expect(dottedFile!.outPath).not.toContain("foo.test");
202+
});
203+
189204
test("dots in paths that collide with existing paths produce a diagnostic", () => {
190205
util.testModule`
191206
import { a } from "./Foo.Bar";

0 commit comments

Comments
 (0)