Skip to content

Commit

Permalink
test: check erasable namespaces are supported
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Jan 29, 2025
1 parent 990b838 commit 918bb0f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,31 @@ test("should not throw on yield new line when stripped", (t) => {
const result = vm.runInContext(code, vm.createContext());
assert.strictEqual(result, 5);
});

test("empty namespaces should be supported", (t) => {
const tests = [
"namespace Empty {}",
`namespace TypeOnly {
type A = string;
export type B = A | number;
export interface I {}
export namespace Inner {
export type C = B;
}
}`,
`namespace My.Internal.Types {
export type Foo = number;
}`,
`namespace With.Imports {
import Types = My.Internal.Types;
export type Foo = Types.Foo;
}`,
];
for(const input of tests) {
const { code } = transformSync(input);
assert.strictEqual(code, "".repeat(input.length));
}
});

0 comments on commit 918bb0f

Please sign in to comment.