Skip to content

Commit

Permalink
chore: Update vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Feb 5, 2025
1 parent 9d64b63 commit ecb2a7a
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 1,147 deletions.
1,300 changes: 162 additions & 1,138 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4032,7 +4032,7 @@
"@types/node": "^20.17.17",
"@types/vscode": "1.90.0",
"@types/vscode-webview": "^1.57.5",
"@vitest/coverage-istanbul": "^2.1.9",
"@vitest/coverage-istanbul": "^3.0.5",
"@vscode/vsce": "^3.2.2",
"ansi-styles": "^6.2.1",
"chokidar-cli": "^3.0.0",
Expand All @@ -4056,7 +4056,7 @@
"typescript": "^5.7.3",
"typescript-eslint": "^8.23.0",
"vite": "^6.1.0",
"vitest": "^2.1.9"
"vitest": "^3.0.5"
},
"dependencies": {
"@cspell/cspell-bundled-dicts": "^8.17.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/_server/src/config/documentSettings.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { getConfiguration, getWorkspaceFolders } from './vscode.config.mjs';
const { toEqualCaseInsensitive: expectToEqualCaseInsensitive } = extendExpect(expect);

vi.mock('vscode-languageserver/node');
vi.mock('./vscode.config');
vi.mock('./vscode.config.mjs');

const mockGetWorkspaceFolders = vi.mocked(getWorkspaceFolders);
const mockGetConfiguration = vi.mocked(getConfiguration);
Expand Down
2 changes: 1 addition & 1 deletion packages/_server/src/progressNotifier.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createProgressNotifier } from './progressNotifier.mjs';
import { createServerApi } from './serverApi.mjs';
import { createMockServerSideApi } from './test/test.api.js';

vi.mock('./serverApi');
vi.mock('./serverApi.mjs');

const mockedCreateClientApi = vi.mocked(createServerApi);
// const mockedCreateConnection = jest.mocked(createConnection);
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/diags.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { determineWordRangeToAddToDictionaryFromSelection, extractMatchingDiagTex

vi.mock('vscode');
vi.mock('vscode-languageclient/node');
vi.mock('./di');
vi.mock('./di.mjs');

const mockGetDependencies = vi.mocked(getDependencies);

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/settings/DictionaryHelper.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {
isTextDocument,
} = __testing__;

vi.mock('../client/client', () => {
vi.mock('../client/client.mjs', () => {
return {
CSpellClient: vi.fn().mockImplementation(() => {
return {
Expand Down
3 changes: 2 additions & 1 deletion packages/client/src/settings/configTargetHelper.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
matchScopeWorkspace,
negatePattern,
quickPickBestMatchTarget,
UnableToFindTarget,
} from './configTargetHelper.mjs';

vi.mock('vscode');
Expand Down Expand Up @@ -109,7 +110,7 @@ describe('configTargetHelper', () => {
mockedShowQuickPick.mockImplementation(async () => undefined);
const targets = sampleTargets();
const fn = await _buildQuickPickBestMatchTargetFn(matchKindNone, matchScopeNone);
await expect(() => fn(targets)).rejects.toEqual(new Error('No matching configuration found.'));
await expect(() => fn(targets)).rejects.toEqual(new UnableToFindTarget('No matching configuration found.'));
});

test('quickPickBestMatchTarget', async () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/client/src/settings/settings.enable.test.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, expect, test, vi } from 'vitest';

import { UnableToFindTarget } from './configTargetHelper.mjs';
import { setEnableSpellChecking, toggleEnableSpellChecker } from './settings.enable.mjs';

vi.mock('vscode');
Expand All @@ -12,7 +13,7 @@ describe('settings.enable', () => {

test('setEnableSpellChecking empty', async () => {
await expect(setEnableSpellChecking({ targets: [], scopes: [] }, true)).rejects.toEqual(
new Error('No matching configuration found.'),
new UnableToFindTarget('No matching configuration found.'),
);
});
});
2 changes: 1 addition & 1 deletion packages/client/src/settings/vsConfigReaderWriter.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createVSConfigReaderWriter } from './vsConfigReaderWriter.mjs';

vi.mock('vscode');
vi.mock('vscode-languageclient/node');
vi.mock('./vsConfig');
vi.mock('./vsConfig.mjs');

const mockedUpdateConfig = vi.mocked(updateConfig);
const mockedCalculateConfigForTarget = vi.mocked(calculateConfigForTarget);
Expand Down

0 comments on commit ecb2a7a

Please sign in to comment.