Skip to content

Commit 3e6fb10

Browse files
Merge master into feature/q-dev-ux
2 parents 3612ab0 + 4d14422 commit 3e6fb10

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/core/src/test/globalSetup.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import { GlobalState } from '../shared/globalState'
2626
import { FeatureConfigProvider } from '../shared/featureConfig'
2727
import { mockFeatureConfigsData } from './fake/mockFeatureConfigData'
2828
import { fs } from '../shared'
29+
import { promises as nodefs } from 'fs' //eslint-disable-line no-restricted-imports
2930

3031
disableAwsSdkWarning()
31-
3232
const testReportDir = join(__dirname, '../../../../../.test-reports') // Root project, not subproject
3333
const testLogOutput = join(testReportDir, 'testLog.log')
3434
const globalSandbox = sinon.createSandbox()
@@ -42,10 +42,9 @@ let openExternalStub: sinon.SinonStub<Parameters<(typeof vscode)['env']['openExt
4242
export async function mochaGlobalSetup(extensionId: string) {
4343
return async function (this: Mocha.Runner) {
4444
// Clean up and set up test logs
45-
try {
46-
await fs.delete(testLogOutput)
47-
} catch (e) {}
48-
await fs.mkdir(testReportDir)
45+
// Use nodefs instead of our fs module (which uses globals.isWeb, which is not initialized yet).
46+
await nodefs.rm(testLogOutput, { force: true })
47+
await nodefs.mkdir(testReportDir, { recursive: true })
4948

5049
sinon.stub(FeatureConfigProvider.prototype, 'listFeatureEvaluations').resolves({
5150
featureEvaluations: mockFeatureConfigsData,

0 commit comments

Comments
 (0)