import * as assert from 'assert' ; import * as vscode from 'vscode' ; import { Utils } from 'vscode-uri' ; import { moduleCallers } from '../../extension' ; import { getDocUri , open , testFolderPath } from '../helper' ; suite ( 'moduleCallers' , ( ) => { teardown ( async ( ) => { await vscode . commands . executeCommand ( 'workbench.action.closeAllEditors' ) ; } ) ; test ( 'should execute language server command' , async ( ) => { const documentUri = getDocUri ( 'modules/sample.tf' ) ; await open ( documentUri ) ; const moduleUri = Utils . dirname ( documentUri ) . toString ( ) ; const response = await moduleCallers ( moduleUri ) ; assert . ok ( response ) ; assert . strictEqual ( response . moduleCallers . length , 1 ) ; assert . strictEqual ( response . moduleCallers [ 0 ] . uri , vscode . Uri . file ( testFolderPath ) . toString ( true ) ) ; } ) ; } ) ;