diff --git a/.vscode-test.js b/.vscode-test.js index ff7242d4..9b4e980e 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__/config-file.ts', 'test/e2e/__tests__/custom-syntax.ts', 'test/e2e/__tests__/format.ts', 'test/e2e/__tests__/ignore-disables.ts', diff --git a/test/e2e/__tests__/config-file.ts b/test/e2e/__tests__/config-file.ts index 33bfeb55..df24571a 100644 --- a/test/e2e/__tests__/config-file.ts +++ b/test/e2e/__tests__/config-file.ts @@ -1,11 +1,22 @@ -import path from 'path'; -import { normalizeDiagnostic } from '../utils'; +import { openDocument, waitForDiagnostics, assertDiagnostics, closeAllEditors } from '../helpers'; describe('"stylelint.configFile" setting', () => { + afterEach(async () => { + await closeAllEditors(); + }); + it('should resolve the config file using the specified path', async () => { - const { document } = await openDocument(path.resolve(workspaceDir, 'config/config-file.css')); + const document = await openDocument('config/config-file.css'); const diagnostics = await waitForDiagnostics(document); - expect(diagnostics.map(normalizeDiagnostic)).toMatchSnapshot(); + assertDiagnostics(diagnostics, [ + { + code: 'block-no-empty', + codeDescription: 'https://stylelint.io/user-guide/rules/block-no-empty', + message: 'Unexpected empty block (block-no-empty)', + range: [0, 2, 0, 4], + severity: 'error', + }, + ]); }); });