Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit b6fb755

Browse files
authored
Merge pull request #554 from Xanewok/tests
Introduce extension tests
2 parents 9ded0e2 + b37b26f commit b6fb755

File tree

13 files changed

+379
-428
lines changed

13 files changed

+379
-428
lines changed

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# dependencies
2-
node_modules/
3-
4-
# generated files
5-
out/
1+
out
2+
node_modules
3+
.vscode-test
4+
*.vsix

.travis.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,29 @@ dist: xenial
33
notifications:
44
email: false
55

6+
os:
7+
- linux
8+
- osx
9+
- windows
10+
611
language: node_js
712

813
node_js:
9-
- 10.2 # Lock to the version shipped with VSCode 1.31+
14+
# - 10.2 # Lock to the version shipped with VSCode 1.31+
15+
# ...except we need to work around https://github.com/nodejs/node/issues/20498
16+
# and include the newer version which unbreaks our testing flow
17+
- 10.5
18+
19+
services:
20+
- xvfb # Required for VSCode extension tests
21+
22+
before_install:
23+
- curl https://sh.rustup.rs -sSf -m 60 | sh -s -- -y -v --default-toolchain stable
24+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then HOME="/c/Users/travis"; fi
25+
- export PATH="$HOME/.cargo/bin:$PATH"
1026

1127
script:
28+
- npm run prettier -- --list-different
1229
- npm run compile
1330
- npm run lint
14-
- npm run prettier -- --list-different
31+
- npm run test

.vscode/launch.json

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
25
{
3-
"version": "0.1.0",
4-
"configurations": [
5-
{
6-
"name": "Launch Extension",
7-
"type": "extensionHost",
8-
"request": "launch",
9-
"runtimeExecutable": "${execPath}",
10-
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
11-
"stopOnEntry": false,
12-
"sourceMaps": true,
13-
"outFiles": ["${workspaceRoot}/out/src/*.js"],
14-
"preLaunchTask": "npm"
15-
}
16-
]
6+
"version": "0.2.0",
7+
"configurations": [{
8+
"name": "Run Extension",
9+
"type": "extensionHost",
10+
"request": "launch",
11+
"runtimeExecutable": "${execPath}",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "npm: watch"
19+
},
20+
{
21+
"name": "Extension Tests",
22+
"type": "extensionHost",
23+
"request": "launch",
24+
"runtimeExecutable": "${execPath}",
25+
"args": [
26+
"--extensionDevelopmentPath=${workspaceFolder}",
27+
"--extensionTestsPath=${workspaceFolder}/out/test"
28+
],
29+
"outFiles": [
30+
"${workspaceFolder}/out/test/**/*.js"
31+
],
32+
"preLaunchTask": "npm: watch"
33+
}
34+
]
1735
}

.vscode/tasks.json

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
1-
// Available variables which can be used inside of strings.
2-
// ${workspaceRoot}: the root folder of the team
3-
// ${file}: the current opened file
4-
// ${fileBasename}: the current opened file's basename
5-
// ${fileDirname}: the current opened file's dirname
6-
// ${fileExtname}: the current opened file's extension
7-
// ${cwd}: the current working directory of the spawned process
8-
9-
// A task runner that calls a custom npm script that compiles the extension.
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
103
{
11-
"version": "0.1.0",
12-
13-
// we want to run npm
14-
"command": "npm",
15-
16-
// the command is a shell script
17-
"isShellCommand": true,
18-
19-
// show the output window only if unrecognized errors occur.
20-
"showOutput": "silent",
21-
22-
// we run the custom script "compile" as defined in package.json
23-
"args": ["run", "compile", "--loglevel", "silent"],
24-
25-
// The tsc compiler is started in watching mode
26-
"isWatching": true,
27-
28-
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
29-
"problemMatcher": "$tsc-watch"
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
3020
}

.vscodeignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
out/test/**
4+
src/**
5+
.gitignore
6+
vsc-extension-quickstart.md
7+
**/tsconfig.json
8+
**/tslint.json
9+
**/*.map
10+
**/*.ts

0 commit comments

Comments
 (0)