-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate
test/e2e/__tests__/custom-syntax.ts
- Loading branch information
1 parent
7b8873d
commit 74436c0
Showing
3 changed files
with
16 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
import path from 'path'; | ||
import pWaitFor from 'p-wait-for'; | ||
import { commands } from 'vscode'; | ||
import * as assert from 'node:assert/strict'; | ||
|
||
import { openDocument, executeAutofix, closeAllEditors } from '../helpers'; | ||
|
||
describe('"stylelint.customSyntax" setting', () => { | ||
afterEach(async () => { | ||
await closeAllEditors(); | ||
}); | ||
|
||
it('should auto-fix using the specified custom syntax', async () => { | ||
const { document } = await openDocument(path.resolve(workspaceDir, 'custom-syntax/test.css')); | ||
const { document } = await openDocument('custom-syntax/test.css'); | ||
|
||
await pWaitFor( | ||
async () => { | ||
const names = await commands.getCommands(); | ||
await executeAutofix(); | ||
|
||
return ( | ||
// cspell:disable-next-line | ||
names.includes('stylelint.executeAutofix') && names.includes('stylelint.applyAutoFix') | ||
); | ||
}, | ||
{ timeout: 2000 }, | ||
assert.equal( | ||
document.getText(), | ||
`/* prettier-ignore */ | ||
.foo .bar | ||
color: red`, | ||
); | ||
|
||
// cspell:disable-next-line | ||
await commands.executeCommand('stylelint.executeAutofix'); | ||
|
||
expect(document.getText()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ | |
{ "path": "stylelint-path" }, | ||
{ "path": "validate" }, | ||
], | ||
"settings": { | ||
}, | ||
"settings": {}, | ||
} |