Skip to content

Commit

Permalink
fix: ts error (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Oct 21, 2023
1 parent a610615 commit 239512c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/server/modules/__tests__/old-stylelint-warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ jest.mock('path');

import fs from 'fs/promises';
import path from 'path';
import type stylelint from 'stylelint';
import type LSP from 'vscode-languageserver-protocol';
import { TextDocument } from 'vscode-languageserver-textdocument';
import { getWorkspaceFolder } from '../../../utils/documents';
import { findPackageRoot } from '../../../utils/packages';
import { OldStylelintWarningModule } from '../old-stylelint-warning';
import { Stylelint } from '../../../utils/stylelint';

const mockedFS = fs as tests.mocks.FSPromisesModule;
const mockedPath = path as tests.mocks.PathModule;
Expand Down Expand Up @@ -102,7 +102,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue(undefined);
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/usr/local/lib/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -240,7 +240,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -269,7 +269,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -303,7 +303,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -332,7 +332,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -361,7 +361,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -392,7 +392,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -429,7 +429,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -473,7 +473,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['bar'];
Expand Down Expand Up @@ -516,7 +516,7 @@ describe('OldStylelintWarningModule', () => {
mockedGetWorkspaceFolder.mockResolvedValue('/path');
mockedFindPackageRoot.mockResolvedValue('/path/node_modules/stylelint');
mockContext.resolveStylelint.mockResolvedValue({
stylelint: {} as unknown as stylelint.PublicApi,
stylelint: {} as unknown as Stylelint,
resolvedPath: '/path/node_modules/stylelint',
});
mockContext.__options.validate = ['baz'];
Expand Down

0 comments on commit 239512c

Please sign in to comment.