@@ -8,7 +8,7 @@ import * as vscode from 'vscode'
8
8
import { getDevfileLocation } from '../../codecatalyst/model'
9
9
import { DevEnvClient } from '../../shared/clients/devenvClient'
10
10
import * as sinon from 'sinon'
11
- const fileSystemUtils = require ( '../../shared/filesystemUtilities' )
11
+ import * as fileSystemUtils from '../../shared/filesystemUtilities'
12
12
13
13
describe ( 'getDevfileLocation' , function ( ) {
14
14
let sandbox : sinon . SinonSandbox
@@ -47,7 +47,7 @@ describe('getDevfileLocation', function () {
47
47
48
48
it ( 'devfile without repo found in workspace root' , async function ( ) {
49
49
const devfilePath = vscode . Uri . parse ( '/projects/WebApplication/devfile.yaml' ) . fsPath
50
- sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( function ( p : string ) {
50
+ sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( async function ( p : string ) {
51
51
return p === devfilePath
52
52
} )
53
53
const client = mockClient ( 'devfile.yaml' )
@@ -57,7 +57,7 @@ describe('getDevfileLocation', function () {
57
57
58
58
it ( 'devfile found in subfolder with repo' , async function ( ) {
59
59
const devfilePath = vscode . Uri . parse ( '/projects/WebApplication/devfile.yaml' ) . fsPath
60
- sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( function ( p : string ) {
60
+ sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( async function ( p : string ) {
61
61
return p === devfilePath
62
62
} )
63
63
const client = mockClient ( 'WebApplication/devfile.yaml' )
@@ -74,7 +74,7 @@ describe('getDevfileLocation', function () {
74
74
75
75
it ( 'falls back to default projects location when devfile cannot be located' , async function ( ) {
76
76
const devfilePath = vscode . Uri . parse ( '/projects/devfile.yaml' ) . fsPath
77
- sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( function ( p : string ) {
77
+ sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( async function ( p : string ) {
78
78
return p === devfilePath
79
79
} )
80
80
const client = mockClient ( 'WebApplication/devfile.yaml' )
@@ -84,7 +84,7 @@ describe('getDevfileLocation', function () {
84
84
85
85
it ( 'falls back to default workspace location when devfile cannot be located' , async function ( ) {
86
86
const devfilePath = vscode . Uri . parse ( '/projects/WebApplication/devfile.yaml' ) . fsPath
87
- sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( function ( p : string ) {
87
+ sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( async function ( p : string ) {
88
88
return p === devfilePath
89
89
} )
90
90
const client = mockClient ( 'devfile.yaml' )
@@ -94,7 +94,7 @@ describe('getDevfileLocation', function () {
94
94
95
95
it ( 'checks project root for devfile when location isnt specified' , async function ( ) {
96
96
const devfilePath = vscode . Uri . parse ( '/projects/devfile.yaml' ) . fsPath
97
- sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( function ( p : string ) {
97
+ sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( async function ( p : string ) {
98
98
return p === devfilePath
99
99
} )
100
100
const client = mockClient ( undefined )
@@ -104,7 +104,7 @@ describe('getDevfileLocation', function () {
104
104
105
105
it ( 'checks workspace root for devfile when location isnt specified' , async function ( ) {
106
106
const devfilePath = vscode . Uri . parse ( '/projects/WebApplication/devfile.yaml' ) . fsPath
107
- sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( function ( p : string ) {
107
+ sandbox . stub ( fileSystemUtils , 'fileExists' ) . callsFake ( async function ( p : string ) {
108
108
return p === devfilePath
109
109
} )
110
110
const client = mockClient ( undefined )
0 commit comments