Skip to content

Commit 8837df2

Browse files
authored
add test case for npm test to verify PRs. (#63)
* add test case for `npm test` to verify PRs. * add the script to install redhat.java extension before executing test
1 parent 3f39262 commit 8837df2

File tree

8 files changed

+249
-38
lines changed

8 files changed

+249
-38
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ out/
66
**/lib
77
**/server
88
**/*.vsix
9+
.vscode-test/
10+
vscode-java-*.vsix
11+
packages/

package-lock.json

Lines changed: 95 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"vscode:prepublish": "tsc -p ./",
8787
"compile": "tsc -watch -p ./",
8888
"postinstall": "node ./node_modules/vscode/bin/install",
89-
"test": "node ./node_modules/vscode/bin/test",
89+
"test": "node ./scripts/download-vscode-for-system-tests && node ./scripts/install-vsix-dependencies redhat.java && node ./scripts/install-vsix-dependencies vscode-java-dependency-0.3.0.vsix && node ./scripts/run-vscode-tests",
9090
"build-server": "./node_modules/.bin/gulp build_server"
9191
},
9292
"extensionDependencies": [
@@ -97,10 +97,12 @@
9797
"@types/mocha": "^5.2.5",
9898
"@types/node": "^6.0.40",
9999
"@types/xml2js": "^0.4.3",
100+
"cross-env": "^5.2.0",
100101
"gulp": "^4.0.0",
101102
"gulp-copy": "^4.0.1",
102103
"gulp-tslint": "^8.1.3",
103104
"mocha": "^5.2.0",
105+
"shelljs": "^0.8.2",
104106
"tslint": "^5.11.0",
105107
"typescript": "^3.1.3",
106108
"vscode": "^1.1.21"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env node
2+
3+
const shell = require('shelljs');
4+
5+
// Downloads an instance of VS Code for tests
6+
7+
if (shell.test('-e', '.vscode-test')) {
8+
// Already downloaded the instance of vscode-test
9+
shell.echo(
10+
'Using already downloaded instance in ' + shell.pwd() + '/.vscode-test'
11+
);
12+
} else {
13+
shell.echo(
14+
'Invoking ' +
15+
shell.pwd() +
16+
'/node_modules/vscode/bin/test for downloading VS Code'
17+
);
18+
shell.exec('node ./node_modules/vscode/bin/test', { silent: true });
19+
}

0 commit comments

Comments
 (0)