Skip to content

Commit 6e5cddc

Browse files
Adding framework for testing extension
- Adding scaffolding for tests - Updated CD/CI GitHub actions for testing in multiple environments
1 parent fe220fe commit 6e5cddc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4235
-314
lines changed

.eslintrc

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
{
2-
"extends": [
3-
"prettier"
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
46
],
5-
"rules": {
6-
"no-use-before-define": "off",
7-
"linebreak-style": "off"
8-
},
9-
"globals": {
10-
"localStorage": false,
11-
"window": false,
12-
"Audio": false,
13-
"io": false,
14-
"$": false,
15-
"document": false
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
],
11+
"rules": {
12+
"semi": [
13+
2,
14+
"always"
15+
],
16+
"@typescript-eslint/no-unused-vars": 0,
17+
"@typescript-eslint/no-explicit-any": 0,
18+
"@typescript-eslint/explicit-module-boundary-types": 0,
19+
"@typescript-eslint/no-non-null-assertion": 0
1620
}
1721
}

.github/workflows/CD.yml

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
name: CD
22

33
on:
4-
push:
5-
branches: [ main ]
4+
release:
5+
types: [ published ]
66
jobs:
77
build:
8-
if: github.event.head_commit.committer.name != 'Versioning Action'
98
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v2
1211
with:
1312
token: ${{ secrets.REPO_ACCESS_TOKEN }}
14-
- uses: tool3/bump@master
15-
id: bump
16-
with:
17-
github_token: ${{ secrets.REPO_ACCESS_TOKEN }}
18-
user: 'Versioning Action'
19-
20-
branch: 'main'
2113
- uses: actions/setup-node@v2-beta
2214
with:
2315
node-version: '12'

.github/workflows/CI.yml

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
name: CI
22

33
on:
4-
push:
5-
branches: [ main ]
64
pull_request:
75
branches: [ main, dev ]
86
jobs:
97
build:
10-
if: github.event.head_commit.committer.name != 'Versioning Action'
11-
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
os: [macos-latest, ubuntu-latest, windows-latest]
11+
runs-on: ${{ matrix.os }}
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v2-beta
15-
with:
16-
node-version: '12'
17-
- name: Install dependencies
18-
run: |
19-
npm install
20-
- name: Build extension
21-
run: |
22-
npm run compile
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Install Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 10.x
19+
- run: npm install
20+
- run: npm run lint
21+
- run: xvfb-run -a npm test
22+
if: runner.os == 'Linux'
23+
- run: npm test
24+
if: runner.os != 'Linux'

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ out
22
node_modules
33
.vscode-test/
44
*.vsix
5-
.env
6-
.vscode/settings.json
7-
dist
8-
package-lock.json
5+
.DS_Store
6+
test/workspace/.vscode

.prettierrc

-5
This file was deleted.

.vscode/launch.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,23 @@
1414
"--extensionDevelopmentPath=${workspaceFolder}"
1515
],
1616
"outFiles": [
17-
"${workspaceFolder}/dist/**/*.js"
17+
"${workspaceFolder}/out/**/*.js"
1818
],
19-
"preLaunchTask": "npm: webpack"
19+
"preLaunchTask": "npm: watch"
2020
},
2121
{
22-
"name": "Extension Tests",
22+
"name": "Run Extension Tests",
2323
"type": "extensionHost",
2424
"request": "launch",
2525
"runtimeExecutable": "${execPath}",
2626
"args": [
27-
"${workspaceFolder}/testworkspace",
28-
"--disable-extensions",
2927
"--extensionDevelopmentPath=${workspaceFolder}",
30-
"--extensionTestsPath=${workspaceFolder}/out/test"
28+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
3129
],
3230
"outFiles": [
3331
"${workspaceFolder}/out/test/**/*.js"
3432
],
35-
"preLaunchTask": "npm: test-compile"
33+
"preLaunchTask": "npm: watch"
3634
}
3735
]
3836
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Adding unit tests for existing extension capabilities
13+
- CI process now confirms all tests pass on Linux, macOS, and Windows
14+
1015
---
1116

1217
## [0.0.10] - 2021-03-08

CONTRIBUTING.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,11 @@ For a contribution to be accepted:
3636
If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the Issue. You can still
3737
continue to add more commits to the branch you have sent the Pull Request from.
3838

39-
## Branching / Processes
40-
41-
We maintain two primary branches:
42-
43-
- `main`: Code that correlates to the latest released version of the extension
44-
- `dev`: Code that is pending release to the Visual Studio Code marketplace
45-
46-
When submitting pull requests, be sure to create your development branch and submit pull requests targeting the
47-
`dev` branch. Merged pull requests will live here until the maintainers merge them to the `main` branch
48-
for an official release.
49-
5039
## How To
5140

5241
1. Fork this repository on GitHub.
5342
1. Clone/fetch your fork to your local development machine.
54-
1. Check out and pull the `dev` branch.
5543
1. Create a new branch (e.g. `issue-12`, `feat.add_foo`, etc) and check it out.
56-
1. Make your changes and commit them. (Did the tests pass?)
44+
1. Make your changes and commit them. (Did the tests pass? No linting errors?)
5745
1. Push your new branch to your fork. (e.g. `git push myname issue-12`)
58-
1. Open a Pull Request from your new branch to the original fork's `dev` branch.
46+
1. Open a Pull Request from your new branch to the original fork's `main` branch.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vonage for Visual Studio Code
22

3-
[![Marketplace](https://vsmarketplacebadge.apphb.com/version/Vonage.vscode.svg?color=blue&style=?style=for-the-badge&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![Installs](https://vsmarketplacebadge.apphb.com/installs-short/Vonage.vscode.svg?color=blue&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![MIT](https://img.shields.io/badge/license-MIT-orange.svg?color=orange&style=flat-square)](https://opensource.org/licenses/MIT)
3+
[![Marketplace](https://vsmarketplacebadge.apphb.com/version/Vonage.vscode.svg?color=blue?style=for-the-badge&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/Vonage.vscode?color=%23ff00ff&logo=Vonage)](https://marketplace.visualstudio.com/items?itemName=Vonage.vscode) [![MIT](https://img.shields.io/badge/license-MIT-orange.svg?color=%2300ffff)](https://opensource.org/licenses/MIT)
44

55
A Visual Studio Code extension for accessing the Vonage communication APIs.
66

0 commit comments

Comments
 (0)