Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
logger.test.ts File Reference

Comprehensive unit tests for the Logger dual-channel logging system. More...

Go to the source code of this file.

Data Structures

class  MockOutputChannelImpl
 Mock implementation for testing output channel behavior. More...
 

Variables

import *as assert from assert
 
import *as vscode from vscode
 
 import { logger, LogType } from '../modules/logger'
 
appendLine __pad0__
 Appends a line of text to the output channel.
 
show __pad1__
 Shows the output channel in VS Code UI.
 
hide __pad2__
 Hides the output channel from VS Code UI.
 
clear __pad3__
 Clears all content from the output channel.
 
dispose __pad4__
 Disposes of the output channel resources.
 
replace __pad5__
 Replaces entire channel content with new value.
 
append __pad6__
 
_lines __pad7__
 
_isVisible __pad8__
 
workspaceState __pad9__
 
globalState __pad10__
 
extensionPath __pad11__
 
storagePath __pad12__
 
globalStoragePath __pad13__
 
logPath __pad14__
 
extensionUri __pad15__
 
environmentVariableCollection __pad16__
 
asAbsolutePath(relativePath:string) storageUri
 
globalStorageUri __pad17__
 
logUri __pad18__
 
extensionMode __pad19__
 
extension __pad20__
 
secrets __pad21__
 
languageModelAccessInformation __pad22__
 

Detailed Description

Comprehensive unit tests for the Logger dual-channel logging system.

Author
Henry Letellier
Version
1.0.10
Since
1.0.4
Date
2025

This test suite provides extensive coverage for the Logger module, which implements a sophisticated logging infrastructure for VS Code extensions with dual-channel output, automatic caller identification, and environment-aware behavior.

Test Coverage Areas:

  • LoggerInternals utility class functionality
  • Gui notification system with interactive features
  • Log main logging controller with dual-channel output
  • Singleton instance behavior and consistency
  • Environment detection and adaptation
  • Caller identification through stack trace analysis
  • Timestamp generation and formatting
  • Configuration integration and debug mode handling
  • Output channel management and console behavior
  • Installation state detection and updates

Testing Strategy:

  • Mocks VS Code APIs for isolated testing
  • Tests both development and production mode behaviors
  • Validates timestamp formats and accuracy
  • Verifies caller identification across different call depths
  • Tests GUI notification interactions and button handling
  • Ensures proper console output filtering by environment
  • Validates configuration system integration
  • Tests error handling and edge cases

Definition in file logger.test.ts.

Variable Documentation

◆ __pad0__

appendLine __pad0__

Appends a line of text to the output channel.

Definition at line 53 of file logger.test.ts.

◆ __pad10__

globalState __pad10__

Definition at line 190 of file logger.test.ts.

◆ __pad11__

extensionPath __pad11__

Definition at line 191 of file logger.test.ts.

◆ __pad12__

storagePath __pad12__

Definition at line 192 of file logger.test.ts.

◆ __pad13__

globalStoragePath __pad13__

Definition at line 193 of file logger.test.ts.

◆ __pad14__

logPath __pad14__

Definition at line 194 of file logger.test.ts.

◆ __pad15__

extensionUri __pad15__

Definition at line 195 of file logger.test.ts.

◆ __pad16__

environmentVariableCollection __pad16__

Definition at line 196 of file logger.test.ts.

◆ __pad17__

globalStorageUri __pad17__

Definition at line 199 of file logger.test.ts.

◆ __pad18__

logUri __pad18__

Definition at line 200 of file logger.test.ts.

◆ __pad19__

extensionMode __pad19__

Definition at line 201 of file logger.test.ts.

◆ __pad1__

show __pad1__

Shows the output channel in VS Code UI.

Definition at line 55 of file logger.test.ts.

◆ __pad20__

extension __pad20__

Definition at line 202 of file logger.test.ts.

◆ __pad21__

secrets __pad21__

Definition at line 203 of file logger.test.ts.

◆ __pad22__

languageModelAccessInformation __pad22__

Definition at line 204 of file logger.test.ts.

◆ __pad2__

hide __pad2__

Hides the output channel from VS Code UI.

Definition at line 57 of file logger.test.ts.

◆ __pad3__

clear __pad3__

Clears all content from the output channel.

Definition at line 59 of file logger.test.ts.

◆ __pad4__

dispose __pad4__

Disposes of the output channel resources.

Definition at line 61 of file logger.test.ts.

◆ __pad5__

replace __pad5__

Replaces entire channel content with new value.

Definition at line 63 of file logger.test.ts.

◆ __pad6__

append __pad6__

Definition at line 64 of file logger.test.ts.

◆ __pad7__

_lines __pad7__

Definition at line 67 of file logger.test.ts.

◆ __pad8__

_isVisible __pad8__

Definition at line 68 of file logger.test.ts.

◆ __pad9__

workspaceState __pad9__

Definition at line 189 of file logger.test.ts.

◆ assert

import* as assert from assert

Definition at line 36 of file logger.test.ts.

◆ import

import { logger, LogType } from '../modules/logger'

Definition at line 38 of file logger.test.ts.

◆ storageUri

asAbsolutePath (relativePath: string) storageUri

Definition at line 198 of file logger.test.ts.

◆ vscode

import* as vscode from vscode

Definition at line 37 of file logger.test.ts.