|
|
@@ -100,16 +100,17 @@ describe("ExtensionHost", () => {
|
|
|
ephemeral: false,
|
|
|
debug: false,
|
|
|
exitOnComplete: false,
|
|
|
+ integrationTest: true, // Set explicitly for testing
|
|
|
}
|
|
|
|
|
|
const host = new ExtensionHost(options)
|
|
|
|
|
|
- // Options are stored but integrationTest is set to true
|
|
|
+ // Options are stored as-is
|
|
|
const storedOptions = getPrivate<ExtensionHostOptions>(host, "options")
|
|
|
expect(storedOptions.mode).toBe(options.mode)
|
|
|
expect(storedOptions.workspacePath).toBe(options.workspacePath)
|
|
|
expect(storedOptions.extensionPath).toBe(options.extensionPath)
|
|
|
- expect(storedOptions.integrationTest).toBe(true) // Always set to true in constructor
|
|
|
+ expect(storedOptions.integrationTest).toBe(true)
|
|
|
})
|
|
|
|
|
|
it("should be an EventEmitter instance", () => {
|
|
|
@@ -298,16 +299,19 @@ describe("ExtensionHost", () => {
|
|
|
})
|
|
|
|
|
|
it("should suppress console when integrationTest is false", () => {
|
|
|
- const host = createTestHost()
|
|
|
+ // Capture the real console.log before any host is created
|
|
|
const originalLog = console.log
|
|
|
|
|
|
- // Override integrationTest to false
|
|
|
+ // Create host with integrationTest: true to prevent constructor from suppressing
|
|
|
+ const host = createTestHost({ integrationTest: true })
|
|
|
+
|
|
|
+ // Override integrationTest to false to test suppression
|
|
|
const options = getPrivate<ExtensionHostOptions>(host, "options")
|
|
|
options.integrationTest = false
|
|
|
|
|
|
callPrivate(host, "setupQuietMode")
|
|
|
|
|
|
- // Console should be modified
|
|
|
+ // Console should be modified (suppressed)
|
|
|
expect(console.log).not.toBe(originalLog)
|
|
|
|
|
|
// Restore for other tests
|
|
|
@@ -332,9 +336,12 @@ describe("ExtensionHost", () => {
|
|
|
|
|
|
describe("restoreConsole", () => {
|
|
|
it("should restore original console methods when suppressed", () => {
|
|
|
- const host = createTestHost()
|
|
|
+ // Capture the real console.log before any host is created
|
|
|
const originalLog = console.log
|
|
|
|
|
|
+ // Create host with integrationTest: true to prevent constructor from suppressing
|
|
|
+ const host = createTestHost({ integrationTest: true })
|
|
|
+
|
|
|
// Override integrationTest to false to actually suppress
|
|
|
const options = getPrivate<ExtensionHostOptions>(host, "options")
|
|
|
options.integrationTest = false
|