Skip to content

Commit

Permalink
some tests infra to spawn a vscode and run tests there
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalsolon committed Dec 24, 2021
1 parent 5796600 commit 9e0650c
Show file tree
Hide file tree
Showing 20 changed files with 1,315 additions and 73 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name: github-actions
repo_token:
8 changes: 6 additions & 2 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run clear
- run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- run: npm run test:vscode
- run: npm run test:vscode:coverage
env:
DISPLAY: ':99.0'
- run: npm run test:unit:coverage
- run: echo ${{ secrets.COVERALLS_TOKEN }} >> ./.coveralls.yml
- run: npm run test:merge

deploy:
if: github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, '[RELEASE]')
Expand All @@ -27,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GH_TOKEN }}
- run: npm install
- run: git config --global user.name 'Anibal Solon'
- run: git config --global user.email '[email protected]'
Expand Down
9 changes: 7 additions & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"spec": "./test/unit/**/*.test.ts",
"ui": "tdd",
"recursive": true,
"require": ["ts-node/register"]
"exit": true,
"require": ["ts-node/register", "source-map-support/register"],
"extension": ["ts"],
"exclude": [
"test/suite/**"
]
}
12 changes: 7 additions & 5 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"extension": [
".ts"
],
"extends": "@istanbuljs/nyc-config-typescript",
"exclude": [
"**/*.d.ts",
"**/*.test.js",
"coverage",
"dist",
"test",
".vscode-test",
"webpack.config.js"
],
"reporter": [
"html"
"html",
"text",
"text-summary"
],
"all": true,
"cache": true
"cache": false,
"source-map": true
}
12 changes: 11 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
"--disable-extensions"
]
},
{
"name": "Run Web Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/data",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentKind=web"
]
},
{
"name": "Run Extension Tests",
"type": "pwa-node",
Expand All @@ -31,7 +41,7 @@
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"test:unittests",
"test:unit",
],
"skipFiles": [
"<node_internals>/**"
Expand Down
Loading

0 comments on commit 9e0650c

Please sign in to comment.