Skip to content

Commit

Permalink
Migrate test/e2e/__tests__/config-file.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Aug 26, 2024
1 parent 74436c0 commit a06280a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
19 changes: 15 additions & 4 deletions test/e2e/__tests__/config-file.ts
Original file line number Diff line number Diff line change
@@ -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',
},
]);
});
});

0 comments on commit a06280a

Please sign in to comment.