From 918bb0fa40036a163d1d7990dcdf5ff18164813a Mon Sep 17 00:00:00 2001
From: Marco Ippolito <marcoippolito54@gmail.com>
Date: Wed, 29 Jan 2025 18:07:54 +0100
Subject: [PATCH] test: check erasable namespaces are supported

---
 test/index.test.js | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/test/index.test.js b/test/index.test.js
index 1b47d649a..8b7319956 100644
--- a/test/index.test.js
+++ b/test/index.test.js
@@ -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));
+	}
+});