|
|
|
@ -47,12 +47,12 @@ export class TestTabLogic { |
|
|
|
|
const splittedFileName = fileName.split('/') |
|
|
|
|
const fileNameToImport = (!hasCurrent) ? fileName : this.currentPath + '/' + splittedFileName[splittedFileName.length - 1] |
|
|
|
|
this.helper.createNonClashingNameWithPrefix(fileNameToImport, fileProvider, '_test', (error: any, newFile: any) => { |
|
|
|
|
// if (error) return modalDialogCustom.alert('Failed to create file. ' + newFile + ' ' + error)
|
|
|
|
|
const isFileCreated = fileProvider.set(newFile, this.generateTestContractSample(hasCurrent, fileName)) |
|
|
|
|
console.log('isFileCreated---->', isFileCreated) |
|
|
|
|
// if (!isFileCreated) return modalDialogCustom.alert('Failed to create test file ' + newFile)
|
|
|
|
|
this.fileManager.open(newFile) |
|
|
|
|
this.fileManager.syncEditor(newFile) |
|
|
|
|
// if (error) return modalDialogCustom.alert('Failed to create file. ' + newFile + ' ' + error)
|
|
|
|
|
const isFileCreated = fileProvider.set(newFile, this.generateTestContractSample(hasCurrent, fileName)) |
|
|
|
|
console.log('isFileCreated---->', isFileCreated) |
|
|
|
|
// if (!isFileCreated) return modalDialogCustom.alert('Failed to create test file ' + newFile)
|
|
|
|
|
this.fileManager.open(newFile) |
|
|
|
|
this.fileManager.syncEditor(newFile) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|