T-16: M0.1b — Make repo-wide bun test green: fix queue, shutdown-signal and research-workflow test failures

This commit is contained in:
Studio 2026-11-27 12:01:06 -05:00
parent 890761e0d5
commit 9c4e87cdfd
17 changed files with 366 additions and 266 deletions

View file

@ -1,23 +1,23 @@
import { existsSync, readFileSync } from 'fs';
import { beforeEach, describe, expect, it, mock } from 'bun:test';
import * as fs from 'fs';
import { afterEach, beforeEach, describe, expect, it, spyOn } from 'bun:test';
import { ConfigLoaderError } from '../src/errors';
import { FileLoader } from '../src/loaders/file.loader';
// Mock fs module
mock.module('fs', () => ({
existsSync: mock(() => false),
readFileSync: mock(() => ''),
}));
describe('FileLoader', () => {
let loader: FileLoader;
let existsSync: ReturnType<typeof spyOn>;
let readFileSync: ReturnType<typeof spyOn>;
const configPath = '/app/config';
const environment = 'development';
beforeEach(() => {
// Reset mocks
(existsSync as any).mockReset();
(readFileSync as any).mockReset();
existsSync = spyOn(fs, 'existsSync').mockReturnValue(false);
readFileSync = spyOn(fs, 'readFileSync').mockReturnValue('' as any);
});
afterEach(() => {
existsSync?.mockRestore();
readFileSync?.mockRestore();
});
describe('constructor', () => {