Skip to content
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
17 changes: 16 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: main
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "13.x"
- run: npm install
- name: Run tests
uses: GabrielBB/xvfb-action@v1.0
with:
run: npm run test
build:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -52,4 +67,4 @@ jobs:
node-version: "13.x"
- run: npm ci
- name: Run devreplay
run: ./node_modules/.bin/devreplay --dir ./src devreplay.json
run: ./node_modules/.bin/devreplay --dir ./src devreplay.json
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
*.xlsx
*.xls
*.DS_Store
dist
dist
.vscode-test
12 changes: 1 addition & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"version": "0.1.0",
"configurations": [

{
"name": "Launch Extension",
"type": "extensionHost",
Expand All @@ -12,17 +13,6 @@
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
"preLaunchTask": "npm"
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
"preLaunchTask": "npm"
}
]
}
83 changes: 83 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@
"vscode:prepublish": "webpack --mode production",
"compile": "webpack --mode none",
"watch": "webpack --mode none --watch",
"test-compile": "tsc -p ./"
"pretest": "tsc -p ./",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/fs-extra": "^8.1.0",
Expand All @@ -504,6 +505,7 @@
"node-atomizr": "^0.6.1",
"ts-loader": "^7.0.2",
"typescript": "^3.8.3",
"vscode-test": "^1.3.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"yamljs": "^0.3.0",
Expand Down
23 changes: 23 additions & 0 deletions src/test/runTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as path from 'path';

import { runTests } from 'vscode-test';

async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');

// The path to the extension test script
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');

// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}

main();
Loading