diff --git a/.vscode-test.js b/.vscode-test.js index 5e173ab3..8a31cc06 100644 --- a/.vscode-test.js +++ b/.vscode-test.js @@ -11,6 +11,7 @@ if (!minimumVscodeVersion) throw new Error(`"engines.vscode" is unexpected: ${pk module.exports = defineConfig({ // TODO: files: ['test/e2e/__tests__/**/*.ts'], files: [ + 'test/e2e/__tests__/report-descriptionless-disables.ts', 'test/e2e/__tests__/report-invalid-scope-disables.ts', 'test/e2e/__tests__/report-needless-disables.ts', 'test/e2e/__tests__/restart.ts', diff --git a/test/e2e/__tests__/report-descriptionless-disables.ts b/test/e2e/__tests__/report-descriptionless-disables.ts index 7a55834c..dd8d7674 100644 --- a/test/e2e/__tests__/report-descriptionless-disables.ts +++ b/test/e2e/__tests__/report-descriptionless-disables.ts @@ -1,17 +1,21 @@ -import path from 'path'; -import { normalizeDiagnostic } from '../utils'; +import { openDocument, waitForDiagnostics, assertDiagnostics, closeAllEditors } from '../helpers'; describe('"stylelint.reportDescriptionlessDisables" setting', () => { + afterEach(async () => { + await closeAllEditors(); + }); + it('should report invalid-scope disables when enabled', async () => { - const { document } = await openDocument( - path.resolve(workspaceDir, 'descriptionless-disables/test.css'), - ); + const { document } = await openDocument('descriptionless-disables/test.css'); const diagnostics = await waitForDiagnostics(document); - expect( - diagnostics - .map(normalizeDiagnostic) - .filter((diagnostic) => diagnostic?.code === '--report-descriptionless-disables'), - ).toMatchSnapshot(); + assertDiagnostics(diagnostics, [ + { + code: '--report-descriptionless-disables', + message: 'Disable for "indentation" is missing a description', + range: [2, 4, 2, 48], + severity: 'error', + }, + ]); }); });