Skip to content

(chore) remove yarn usage in syntax highlight test #2043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/svelte-vscode/syntaxes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ A good document to read in more detail about TextMate: https://www.apeth.com/non

## Developing the grammar

The grammar for pug and markdown is written in JSON. You can edit that directly. The main grammar is written in `yaml` because that's easier to structure than JSON. However, VS Code expects a JSON format. Therefore you need to run the `build:grammar` script afterwards. This will produce a JSON version of the file. Afterwards you need to restart your extension window for the changes to take effect.
The grammar for pug and markdown is written in JSON. You can edit that directly. The main grammar is written in `yaml` because that's easier to structure than JSON. However, VS Code expects a JSON format. Therefore you need to run the `build:`grammar` script afterward. This will produce a JSON version of the file. Afterward, you need to restart your extension window for the changes to take effect.

### Snapshot test for the grammar

The snapshot test is run by [vscode-textmate-test](https://github.com/PanAeon/vscode-tmgrammar-test). The `test` command called a node script to build the argument and execute the `vscode-textmate-test` command. If you updated the svelte grammar file, Be sure to add the test cases to the `test/sample` directory.
The snapshot test is run by [vscode-textmate-test](https://github.com/PanAeon/vscode-tmgrammar-test). The `test` command calls a node script to build the argument and execute the `vscode-textmate-test` command. If you updated the svelte grammar file, Be sure to add the test cases to the `test/sample` directory.

Then run the test to check if the update affect existing cases
Then run the test to check if the update affects existing cases

```bash
yarn test
pnpm run test
```

Update existing snapshot to match the changes
Update existing snapshots to match the changes

```bash
yarn test --updateSnapshot
pnpm run test -- --updateSnapshot
```
2 changes: 1 addition & 1 deletion packages/svelte-vscode/test/grammar/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function snapShotTest() {
...extraArgs
];

const code = await promisifySpawn(process.platform === 'win32' ? 'yarn.cmd' : 'yarn', args, {
const code = await promisifySpawn(process.platform === 'win32' ? 'npx.cmd' : 'npx', args, {
stdio: 'inherit'
});

Expand Down