mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-03 14:10:43 +00:00
(chore)fix: test fails on Windows CI
This commit is contained in:
parent
4ae8584c81
commit
fd6c7364e8
2 changed files with 25 additions and 7 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
|
||||
// Mock fs module
|
||||
vi.mock('node:fs', () => ({
|
||||
|
|
@ -172,11 +173,15 @@ describe('languageUtils', () => {
|
|||
it('should create directory and write file', () => {
|
||||
writeOutputLanguageFile('Chinese');
|
||||
|
||||
expect(fs.mkdirSync).toHaveBeenCalledWith('/mock/home/.qwen', {
|
||||
const globalDir = '/mock/home/.qwen';
|
||||
const expectedDir = path.join(globalDir);
|
||||
const expectedFilePath = path.join(globalDir, 'output-language.md');
|
||||
|
||||
expect(fs.mkdirSync).toHaveBeenCalledWith(expectedDir, {
|
||||
recursive: true,
|
||||
});
|
||||
expect(fs.writeFileSync).toHaveBeenCalledWith(
|
||||
'/mock/home/.qwen/output-language.md',
|
||||
expectedFilePath,
|
||||
expect.any(String),
|
||||
'utf-8',
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue