From 6a236b58e65313d0800848ec341dd0e2d4749a88 Mon Sep 17 00:00:00 2001 From: Chema Balsas Date: Tue, 28 Mar 2023 17:15:37 +0100 Subject: [PATCH] Fixes server/modules/formatter tests Fix copied from original PR https://github.com/stylelint/vscode-stylelint/pull/426/files#diff-f2680deb1906c0920d4e4b4f73879a32a741ed4288aabb2a218a2eef48f38211 --- src/server/modules/__tests__/formatter.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/modules/__tests__/formatter.ts b/src/server/modules/__tests__/formatter.ts index 8ca67601..f931a7d2 100644 --- a/src/server/modules/__tests__/formatter.ts +++ b/src/server/modules/__tests__/formatter.ts @@ -28,13 +28,15 @@ import { Position, TextEdit } from 'vscode-languageserver-types'; import { Notification } from '../../types'; import { FormatterModule } from '../formatter'; -const mockContext = serverMocks.getContext(); -const mockLogger = serverMocks.getLogger(); +let mockContext = serverMocks.getContext(); +let mockLogger = serverMocks.getLogger(); describe('FormatterModule', () => { beforeEach(() => { + jest.restoreAllMocks(); + mockContext = serverMocks.getContext(); mockContext.__options.validate = []; - jest.clearAllMocks(); + mockLogger = serverMocks.getLogger(); }); test('should be constructable', () => {