Skip to content

Commit

Permalink
Migrate test/e2e/__tests__/report-descriptionless-disables.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Aug 26, 2024
1 parent f822d95 commit 50ef3f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 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__/report-descriptionless-disables.ts',
'test/e2e/__tests__/report-invalid-scope-disables.ts',
'test/e2e/__tests__/report-needless-disables.ts',
'test/e2e/__tests__/restart.ts',
Expand Down
24 changes: 14 additions & 10 deletions test/e2e/__tests__/report-descriptionless-disables.ts
Original file line number Diff line number Diff line change
@@ -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 () => {

Check warning on line 8 in test/e2e/__tests__/report-descriptionless-disables.ts

View workflow job for this annotation

GitHub Actions / lint / Lint on Node.js lts/* and ubuntu-latest

Test has no assertions
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',
},
]);
});
});

0 comments on commit 50ef3f6

Please sign in to comment.