Skip to content

Commit

Permalink
test: Work on test runner (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Sep 30, 2023
1 parent c3c1afc commit 3ebb117
Show file tree
Hide file tree
Showing 247 changed files with 4,437 additions and 4,268 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,16 @@ jobs:
- run: |
cd ${{ matrix.extension_dir }}
npm run pack-extension
npm run test:cspell
- name: Run Linux
if: runner.os == 'Linux'
run: |
cd ${{ matrix.extension_dir }}
xvfb-run -a npm run test
- name: Run Windows and MacOS
if: runner.os != 'Linux'
run: |
cd ${{ matrix.extension_dir }}
npm run test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ typings/
*.vsix

extensions/*/out

temp
.cache
.vscode-*
.vscode-test
29 changes: 15 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ yo cspell-dict-extensions <language>

Yeoman will ask you a series of questions most of which default suggestion is ok (to select default suggestion press enter without typing):

| Field | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **name** | this is the dictionary. i.e. `swedish`, `ruby`, or `rust` |
| friendly name | this is the friendly name, like `Swedish` |
| display name | this is the name shown on the VS Code Extensions page. |
| description | short description of the extension. |
| **Source Dictionary** | This is the NPM install name of the source eg. dictionary `@cspell/dict-sv` (@ is needed). Available dictionaries could be found here [https://github.com/streetsidesoftware/cspell-dicts#all-dictionaries](https://github.com/streetsidesoftware/cspell-dicts#all-dictionaries) |
| Add Enable / Disable Commands | This is used for adding helper commands for human language locals like `fr` for French or `fr,fr_CA` for Canadian French. This option is not necessary for word lists like `companies` or programming languages. |
| Base Name For Commands | This is added as a suffix onto the command names. |
| Language Locale | This is the two letter language code supported by the dictionary included in the `Source Dictionary` step. |
| Target Directory | Where to create the extension |
| NPM Package Name | name added to the `package.json` |
| Field | Description |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **name** | this is the dictionary. i.e. `swedish`, `ruby`, or `rust` |
| friendly name | this is the friendly name, like `Swedish` |
| display name | this is the name shown on the VS Code Extensions page. |
| description | short description of the extension. |
| **Source Dictionary** | This is the NPM install name of the source eg. dictionary `@cspell/dict-sv` (@ is needed). Available dictionaries could be found here [https://github.com/streetsidesoftware/cspell-dicts#all-dictionaries](https://github.com/streetsidesoftware/cspell-dicts#all-dictionaries) |
| Add Enable / Disable Commands | This is used for adding helper commands for human language locals like `fr` for French or `fr,fr_CA` for Canadian French. This option is not necessary for word lists like `companies` or programming languages. |
| Base Name For Commands | This is added as a suffix onto the command names. |
| Language Locale | This is the two letter language code supported by the dictionary included in the `Source Dictionary` step. |
| Target Directory | Where to create the extension |
| NPM Package Name | name added to the `package.json` |

After all the information is entered, the extension should be generated.

Expand All @@ -70,7 +70,9 @@ npm run build
```

Please update files:

- `README.md`

- Add yourself as contributor under `## Contributors` header

```txt
Expand All @@ -79,7 +81,7 @@ Please update files:
- `extensions/<language>/samples/seattle.md`
- Go to Seattle wikipedia page translated to your language and copy some content to `seattle.md`. It's later used to test if plugin recognizes words
Please update files if necessary (leave it as unless you know why you're changing it):
- `extensions/<language>/README.md`
Expand Down Expand Up @@ -121,4 +123,3 @@ Shortly after pull request is merged extension will appear in vscode extensions
<a href="https://github.com/streetsidesoftware/cspell-dicts/graphs/contributors">
<img src="https://contrib.rocks/image?repo=streetsidesoftware/cspell-dicts&r=" width="800px"/>
</a>

1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ vsix
WIPO
yosay
Yoyodyne
xvfb
3 changes: 3 additions & 0 deletions dict-extensions.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{
"path": "."
},
{
"path": "test-runner"
},
{
"path": "extensions/arabic"
},
Expand Down
6 changes: 4 additions & 2 deletions extensions/arabic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"onStartupFinished"
],
"qna": "marketplace",
"main": "./out/src/extension",
"main": "./out/extension.js",
"contributes": {
"commands": [
{
Expand Down Expand Up @@ -72,7 +72,9 @@
"vscode:prepublish": "npm run build",
"build": "tsc -p ./",
"watch": "tsc -watch -p ./",
"test": "node ../../node_modules/vscode/bin/test"
"test:cspell": "cspell -c cspell-ext.json samples",
"test:vscode": "node ../../test-runner/bin.mjs . --sample samples/README-ar.md",
"test": "npm run test:cspell && npm run test:vscode"
},
"dependencies": {
"@cspell/dict-ar": "^1.1.0"
Expand Down
1 change: 1 addition & 0 deletions extensions/arabic/samples/cspell.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"language": "ar,en",
"words": [
"Ayaspell",
"myspell"
Expand Down
2 changes: 1 addition & 1 deletion extensions/arabic/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('cSpellExt_arabic.enable', () => enable(true)),
vscode.commands.registerCommand('cSpellExt_arabic.disable', () => disable(true)),
vscode.commands.registerCommand('cSpellExt_arabic.enableWorkspace', () => enable(false)),
vscode.commands.registerCommand('cSpellExt_arabic.disableWorkspace', () => disable(false))
vscode.commands.registerCommand('cSpellExt_arabic.disableWorkspace', () => disable(false)),
);
//
}
Expand Down
23 changes: 0 additions & 23 deletions extensions/arabic/test/extension.test.ts

This file was deleted.

22 changes: 0 additions & 22 deletions extensions/arabic/test/index.ts

This file was deleted.

38 changes: 0 additions & 38 deletions extensions/arabic/vsc-extension-quickstart.md

This file was deleted.

6 changes: 4 additions & 2 deletions extensions/australian-english/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"onStartupFinished"
],
"qna": "marketplace",
"main": "./out/src/extension",
"main": "./out/extension.js",
"contributes": {
"commands": [
{
Expand Down Expand Up @@ -72,7 +72,9 @@
"vscode:prepublish": "npm run build",
"build": "tsc -p ./",
"watch": "tsc -watch -p ./",
"test": "node ../../node_modules/vscode/bin/test"
"test:cspell": "cspell -c cspell-ext.json samples",
"test:vscode": "node ../../test-runner/bin.mjs .",
"test": "npm run test:cspell && npm run test:vscode"
},
"dependencies": {
"@cspell/dict-en-au": "^1.0.3"
Expand Down
2 changes: 2 additions & 0 deletions extensions/australian-english/samples/seattle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ The Seattle area was inhabited by Native Americans for at least 4,000 years befo

<!---
Please download some sample text. The Seattle wikipedia site is translated into many languages and provides a good sample.
cspell:ignore siˈætəl Alki Si'ahl Duwamish Suquamish
--->
2 changes: 1 addition & 1 deletion extensions/australian-english/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('cSpellExt_australian-english.enable', () => enable(true)),
vscode.commands.registerCommand('cSpellExt_australian-english.disable', () => disable(true)),
vscode.commands.registerCommand('cSpellExt_australian-english.enableWorkspace', () => enable(false)),
vscode.commands.registerCommand('cSpellExt_australian-english.disableWorkspace', () => disable(false))
vscode.commands.registerCommand('cSpellExt_australian-english.disableWorkspace', () => disable(false)),
);
//
}
Expand Down
23 changes: 0 additions & 23 deletions extensions/australian-english/test/extension.test.ts

This file was deleted.

22 changes: 0 additions & 22 deletions extensions/australian-english/test/index.ts

This file was deleted.

6 changes: 4 additions & 2 deletions extensions/austrian-german/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"onStartupFinished"
],
"qna": "marketplace",
"main": "./out/src/extension",
"main": "./out/extension.js",
"contributes": {
"commands": [
{
Expand Down Expand Up @@ -72,7 +72,9 @@
"vscode:prepublish": "npm run build",
"build": "tsc -p ./",
"watch": "tsc -watch -p ./",
"test": "node ../../node_modules/vscode/bin/test"
"test:cspell": "cspell -c cspell-ext.json samples",
"test:vscode": "node ../../test-runner/bin.mjs .",
"test": "npm run test:cspell && npm run test:vscode"
},
"dependencies": {
"@cspell/dict-de-at": "^1.0.0"
Expand Down
1 change: 1 addition & 0 deletions extensions/austrian-german/samples/sample1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Verantwortlich für den Betrieb und die Unterhaltung des gesamten Kanals ist Rij

<!---
cspell:words Noordzeekanaal IJmuiden Schellingwoude Markermeer Normaal Rijkswaterstaat Tiel
cspell:ignore Waal
--->
3 changes: 3 additions & 0 deletions extensions/austrian-german/samples/seattle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ Im Dezember 1999 kam es am Rande der WTO-Konferenz in Seattle in der Stadt zu he
<!---
cspell:ignore Alki Duwamish Boeingwerke Maynards Sealth siˈɛtl̩ Smaragdstadt Suquamish Swinson sɪˈætəl
cspell:ignore Katastergrenzen
cspell:ignore County Puget Emerald Denny Denny Elliott Plats Mother Damnable Puget versechsfachte Yukon Coliseum Monorail Villages Strategy infrastruktureller
--->
2 changes: 1 addition & 1 deletion extensions/austrian-german/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function activate(context: vscode.ExtensionContext) {
vscode.commands.registerCommand('cSpellExt_austrian-german.enable', () => enable(true)),
vscode.commands.registerCommand('cSpellExt_austrian-german.disable', () => disable(true)),
vscode.commands.registerCommand('cSpellExt_austrian-german.enableWorkspace', () => enable(false)),
vscode.commands.registerCommand('cSpellExt_austrian-german.disableWorkspace', () => disable(false))
vscode.commands.registerCommand('cSpellExt_austrian-german.disableWorkspace', () => disable(false)),
);
//
}
Expand Down
23 changes: 0 additions & 23 deletions extensions/austrian-german/test/extension.test.ts

This file was deleted.

Loading

0 comments on commit 3ebb117

Please sign in to comment.