chore: Bump version to 1.0.6 and update package.json for adapter-electron

- Added placeholders.d.ts to the files list.
- Updated dependencies for electron and cookie.
- Introduced new scripts for testing and type checking.
- Adjusted devDependencies for compatibility with TypeScript and testing tools.
This commit is contained in:
Luke Hagar
2025-07-13 02:09:19 -05:00
parent 196fc9d774
commit 90d204edf3
9 changed files with 1408 additions and 59 deletions

View File

@@ -0,0 +1,35 @@
// Test setup file for vitest
import { vi } from 'vitest';
// Mock __dirname for ES modules
global.__dirname = process.cwd();
// Mock process.env defaults
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
// Global test utilities
global.mockElectronRequest = (overrides = {}) => ({
url: 'http://127.0.0.1/test',
method: 'GET',
headers: new Map(),
body: null,
uploadData: [],
...overrides
});
global.mockElectronSession = (overrides = {}) => ({
cookies: {
get: vi.fn().mockResolvedValue([]),
set: vi.fn().mockResolvedValue(),
remove: vi.fn().mockResolvedValue()
},
...overrides
});
// Suppress console.error in tests unless specifically testing error handling
const originalConsoleError = console.error;
console.error = (...args) => {
if (process.env.VITEST_SHOW_ERRORS === 'true') {
originalConsoleError(...args);
}
};