Skip to content

Commit fbaad3c

Browse files
authored
👻 Add unit test mocks to fix release-0.2 branch (konveyor#1040)
Signed-off-by: Ian Bolton <ibolton@redhat.com>
1 parent 2f11891 commit fbaad3c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

vscode/.mocharc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"import": "tsx",
33
"extension": ["ts"],
4-
"spec": "src/**/__tests__/*test.ts"
4+
"spec": "src/**/__tests__/*test.ts",
5+
"require": ["src/test/setup.ts"]
56
}

vscode/src/test/setup.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Test setup file - mocks webpack-defined globals
2+
// This file is loaded before all tests run
3+
4+
// Mock webpack DefinePlugin globals for test environment
5+
(global as any).__EXTENSION_NAME__ = "konveyor";
6+
(global as any).__EXTENSION_AUTHOR__ = "Konveyor";
7+
(global as any).__EXTENSION_PUBLISHER__ = "konveyor";
8+
(global as any).__EXTENSION_VERSION__ = "0.0.0-test";
9+
(global as any).__EXTENSION_DISPLAY_NAME__ = "Konveyor Extension for VSCode";
10+
(global as any).__EXTENSION_SHORT_NAME__ = "Konveyor";
11+
(global as any).__BUILD_GIT_SHA__ = "test-sha";
12+
(global as any).__BUILD_GIT_SHA_SHORT__ = "test";
13+
(global as any).__BUILD_TIMESTAMP__ = new Date().toISOString();

0 commit comments

Comments
 (0)