Skip to content
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

Add testing #179

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
15 changes: 11 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--disable-extensions"
],
"preLaunchTask": {
"type": "npm",
"script": "compile"
Expand All @@ -21,8 +24,12 @@
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
"${workspaceRoot}/client/testFixture"
]
"${workspaceRoot}/client/src/test/testFixture"
],
"preLaunchTask": {
"type": "npm",
"script": "compile:tests"
}
}
]
}
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
2 changes: 1 addition & 1 deletion client/src/test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export let platformEol: string;
*/
export async function activate(docUri: vscode.Uri) {
// The extensionId is `publisher.name` from package.json
const ext = vscode.extensions.getExtension('vscode-samples.lsp-sample')!;
const ext = vscode.extensions.getExtension('TheNuProjectContributors.vscode-nushell-lang')!;
await ext.activate();
try {
doc = await vscode.workspace.openTextDocument(docUri);
Expand Down
1 change: 1 addition & 0 deletions client/src/test/testFixture/sample.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
something; something = "nothing"
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"Programming Languages",
"Snippets"
],
"activationEvents": [
"onTerminalProfile:nushell_default"
],
"activationEvents": [],
"main": "out/client/src/extension.js",
"contributes": {
"languages": [
Expand Down Expand Up @@ -139,6 +137,7 @@
"install": "cd server && npm install && cd ../client && npm install && cd ..",
"watch": "npm run esbuild-base -- --sourcemap --watch",
"lint": "npx eslint ./client/src ./server/src --ext .ts,.tsx",
"compile:tests": "tsc -b",
"test": "sh ./scripts/e2e.sh"
},
"dependencies": {
Expand Down Expand Up @@ -173,4 +172,4 @@
"color": "#008000",
"theme": "light"
}
}
}
Loading