@@ -2,8 +2,7 @@ import { TestHelper } from '../../helper';
22import * as vscode from 'vscode' ;
33import * as assert from 'assert' ;
44
5- suite ( 'Smoke Tests' , function ( ) {
6- this . timeout ( 30000 ) ;
5+ suite ( 'Smoke Tests' , ( ) => {
76 test ( 'Extension loads and activates without errors' , async ( ) => {
87 const extensionId = TestHelper . getExtensionId ( ) ;
98 const extension = vscode . extensions . getExtension ( extensionId ) ;
@@ -38,40 +37,10 @@ suite('Smoke Tests', function() {
3837 const response = await client . sendRequest < { result ?: null ; error ?: string ; } > ( 'generateModelForProject' , { filePath : mockFilePath } ) ;
3938
4039 assert . ok ( response , 'Should receive a response from the server' ) ;
41- assert . strictEqual ( response . result , null , 'Response should indicate failure due to mock path' ) ;
42- // assert.ok(response.error, 'Response should include an error message');
40+ assert . strictEqual ( response . result , undefined , 'Response should indicate failure due to mock path' ) ;
41+ assert . ok ( response . error , 'Response should include an error message' ) ;
4342 } catch ( error ) {
4443 assert . fail ( `Failed to communicate with the server: ${ error } ` ) ;
4544 }
4645 } ) ;
47- test ( 'Generates Famix model for a TypeScript project' , async function ( ) {
48- const fs = require ( 'fs' ) ;
49- const path = require ( 'path' ) ;
50-
51- const fixturePath = path . resolve ( __dirname , '../../../../src/test/fixtures/project-with-tsconfig' ) ;
52- const modelPath = path . join ( fixturePath , 'model.json' ) ;
53-
54- // S'assurer que model.json n'existe pas avant le test
55- if ( fs . existsSync ( modelPath ) ) {
56- fs . unlinkSync ( modelPath ) ;
57- }
58- assert . ok ( ! fs . existsSync ( modelPath ) , 'model.json should not exist before the test' ) ;
59-
60- // Configurer le chemin du modèle
61- const config = vscode . workspace . getConfiguration ( 'ts2famix' ) ;
62- await config . update ( 'FamixModelOutputFilePath' , modelPath , vscode . ConfigurationTarget . Global ) ;
63-
64- // Invoquer la commande de génération
65- await vscode . commands . executeCommand ( 'ts2famix.generateModelForProject' ) ;
66-
67- // Attendre que le fichier soit généré
68- await new Promise ( resolve => setTimeout ( resolve , 8000 ) ) ;
69-
70- // Vérifier que model.json existe
71- assert . ok ( fs . existsSync ( modelPath ) , 'model.json should exist after generation' ) ;
72-
73- // Nettoyer
74- fs . unlinkSync ( modelPath ) ;
75- assert . ok ( ! fs . existsSync ( modelPath ) , 'model.json should be deleted after the test' ) ;
76- } ) ;
7746} ) ;
0 commit comments