Skip to content

Commit

Permalink
fix windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jan 23, 2024
1 parent 515bf19 commit 0bdd99d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/backend/src/managers/modelsManager.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type MockInstance, beforeEach, expect, test, vi } from 'vitest';
import os from 'os';
import os, { platform } from 'os';

Check failure on line 2 in packages/backend/src/managers/modelsManager.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / windows-2022

'platform' is defined but never used

Check failure on line 2 in packages/backend/src/managers/modelsManager.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / ubuntu-22.04

'platform' is defined but never used

Check failure on line 2 in packages/backend/src/managers/modelsManager.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / macos-12

'platform' is defined but never used
import fs from 'node:fs';
import path from 'node:path';
import { ModelsManager } from './modelsManager';
Expand Down Expand Up @@ -64,5 +64,9 @@ test('getLocalModels should return an empty array if the models folder does not
const manager = new ModelsManager('/home/user/aistudio');
const models = manager.getLocalModels();
expect(models).toEqual([]);
expect(existsSyncSpy).toHaveBeenCalledWith('/home/user/aistudio/models');
if (process.platform === 'win32') {
expect(existsSyncSpy).toHaveBeenCalledWith('\\home\\user\\aistudio\\models');
} else {
expect(existsSyncSpy).toHaveBeenCalledWith('/home/user/aistudio/models');
}
});

0 comments on commit 0bdd99d

Please sign in to comment.