From c0783a5cf1a0d572b585c680b202bea740078583 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Sat, 21 Oct 2023 17:02:26 +0900 Subject: [PATCH] fix --- test/integration/stylelint-vscode/test.ts | 31 +++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/test/integration/stylelint-vscode/test.ts b/test/integration/stylelint-vscode/test.ts index 36e2e651..ba4e5ddc 100644 --- a/test/integration/stylelint-vscode/test.ts +++ b/test/integration/stylelint-vscode/test.ts @@ -3,6 +3,7 @@ import { pathToFileURL } from 'url'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { StylelintRunner } from '../../../src/utils/stylelint'; import { version as stylelintVersion } from 'stylelint/package.json'; +import { version as stylelintScssVersion } from 'stylelint-scss/package.json'; import semver from 'semver'; const createDocument = (uri: string | null, languageId: string, contents: string): TextDocument => @@ -264,23 +265,25 @@ a { color: #000 } expect(result.diagnostics).toMatchSnapshot(); }); - test('should be resolved with diagnostic plugin rule URL', async () => { - expect.assertions(1); - const runner = new StylelintRunner(); - const result = await runner.lintDocument( - createDocument('unknown-rule.scss', 'scss', '@unknown (max-width: 960px) {}'), - { - config: { - plugins: ['stylelint-scss'], - rules: { - 'scss/at-rule-no-unknown': true, + if (semver.satisfies(stylelintScssVersion, '^15')) { + test('should be resolved with diagnostic plugin rule URL', async () => { + expect.assertions(1); + const runner = new StylelintRunner(); + const result = await runner.lintDocument( + createDocument('unknown-rule.scss', 'scss', '@unknown (max-width: 960px) {}'), + { + config: { + plugins: ['stylelint-scss'], + rules: { + 'scss/at-rule-no-unknown': true, + }, }, }, - }, - ); + ); - expect(result.diagnostics).toMatchSnapshot(); - }); + expect(result.diagnostics).toMatchSnapshot(); + }); + } }); describe('StylelintRunner with a configuration file', () => {