Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Oct 21, 2023
1 parent 2f36071 commit c0783a5
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions test/integration/stylelint-vscode/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit c0783a5

Please sign in to comment.