import { workspace , Uri , WorkspaceConfiguration , TextDocument , WorkspaceFolder } from 'vscode' ; import { SinonStub , stub } from 'sinon' ; let getConfigurationStub ; const mockBaseConfiguration = { has ( section ) { return true ; } , inspect ( section ) { return undefined ; } , async update ( section , value ) { } } ; const mockDebugConfigurationJson = { } ; const mockDebugConfiguration = { ... mockBaseConfiguration , get ( section ) { return mockDebugConfigurationJson [ section ] ; } } ; param enabled export function mockPreviewJavaScriptDebugger ( enabled ? ) { getConfigurationStub = stub ( workspace , 'getConfiguration' ) ; mockDebugConfigurationJson [ 'javascript.usePreview' ] = enabled ; getConfigurationStub . returns ( mockDebugConfiguration ) ; } export function unmockPreviewJavaScriptDebugger ( ) { getConfigurationStub . restore ( ) ; }