@@ -27,14 +27,52 @@ async function startTestServer() {
2727 ) ;
2828 }
2929
30- if ( ! fs . existsSync ( workspacePath ) ) {
31- console . log ( '📁 Creating test workspace directory...' ) ;
32- fs . mkdirSync ( workspacePath , { recursive : true } ) ;
30+ // Verify extension is built (check for critical files)
31+ const distPath = path . join ( extensionDevelopmentPath , 'dist' ) ;
32+ const packageJsonPath = path . join ( distPath , 'package.json' ) ;
33+ const extensionJsPath = path . join ( distPath , 'extension.js' ) ;
34+ const extensionWebJsPath = path . join ( distPath , 'extension.web.js' ) ;
35+
36+ if ( ! fs . existsSync ( distPath ) ) {
37+ throw new Error (
38+ `Extension dist directory not found: ${ distPath } . Run 'npm run build' in the extension directory first.` ,
39+ ) ;
40+ }
41+
42+ if ( ! fs . existsSync ( packageJsonPath ) ) {
43+ throw new Error (
44+ `Extension package.json not found in dist: ${ packageJsonPath } . Extension build may be incomplete.` ,
45+ ) ;
46+ }
47+
48+ if ( ! fs . existsSync ( extensionJsPath ) ) {
49+ throw new Error (
50+ `Extension main file not found: ${ extensionJsPath } . Extension build may be incomplete.` ,
51+ ) ;
52+ }
53+
54+ if ( ! fs . existsSync ( extensionWebJsPath ) ) {
55+ console . warn (
56+ `⚠️ Extension web file not found: ${ extensionWebJsPath } . Web functionality may be limited.` ,
57+ ) ;
3358 }
59+ fs . mkdirSync ( workspacePath , { recursive : true } ) ;
3460
3561 console . log ( '🌐 Starting VS Code Web Test Server...' ) ;
3662 console . log ( `📁 Extension path: ${ extensionDevelopmentPath } ` ) ;
3763 console . log ( `📂 Workspace path: ${ workspacePath } ` ) ;
64+ console . log ( `🔍 CI environment: ${ process . env . CI ? 'Yes' : 'No' } ` ) ;
65+
66+ // Log extension files for debugging
67+ console . log ( '📋 Extension files:' ) ;
68+ const distFiles = fs . readdirSync ( distPath ) ;
69+ distFiles . forEach ( ( file ) => {
70+ const filePath = path . join ( distPath , file ) ;
71+ const stats = fs . statSync ( filePath ) ;
72+ console . log (
73+ ` ${ file } (${ stats . isDirectory ( ) ? 'dir' : stats . size + ' bytes' } )` ,
74+ ) ;
75+ } ) ;
3876
3977 // Start the web server (this will keep running)
4078 await runTests ( {
@@ -77,4 +115,4 @@ process.on('SIGTERM', () => {
77115
78116if ( require . main === module ) {
79117 startTestServer ( ) ;
80- }
118+ }
0 commit comments