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

Comprehensive unit tests for the RandomLogo ASCII art management system. More...

Go to the source code of this file.

Data Structures

class  MockWebview
 Mock implementation of VS Code webview for testing. More...
 
class  MockWebviewPanel
 Mock implementation of VS Code webview panel for testing. More...
 

Variables

import *as assert from assert
 
import *as vscode from vscode
 
import *as fs from fs promises
 
import *as path from path
 
import *as os from os
 
 import { RandomLogo, logo } from '../modules/randomLogo'
 

Detailed Description

Comprehensive unit tests for the RandomLogo ASCII art management system.

Author
Henry Letellier
Version
1.0.10
Since
1.0.4
Date
2025

This test suite provides extensive coverage for the RandomLogo module, which manages the discovery, selection, and display of ASCII art logos stored in text files.

Test Coverage Areas:

  • Constructor initialization and parameter handling
  • File path and working directory management
  • Logo file discovery and directory traversal
  • Random logo selection algorithms
  • Error handling for invalid files and missing directories
  • HTML content generation and webview creation
  • Interactive feature scripts (copy, zoom functionality)
  • File system operations and path resolution
  • Integration with LazyFileLoader and VS Code APIs

Testing Strategy:

  • Uses real temporary files and directories for authentic operations
  • Mocks VS Code webview APIs for isolated testing
  • Validates ASCII art content and file structure integrity
  • Tests edge cases and error conditions
  • Verifies HTML output and JavaScript functionality
  • Ensures proper resource cleanup and memory management

Definition in file randomLogo.test.ts.

Variable Documentation

◆ assert

import* as assert from assert

Definition at line 32 of file randomLogo.test.ts.

◆ import

import { RandomLogo, logo } from '../modules/randomLogo'

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

◆ os

import* as os from os

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

◆ path

import* as path from path

Definition at line 35 of file randomLogo.test.ts.

◆ promises

import* as fs from fs promises

Definition at line 34 of file randomLogo.test.ts.

◆ vscode

import* as vscode from vscode

Definition at line 33 of file randomLogo.test.ts.