Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 0df5c4c

Browse files
authored
Merge pull request #143 from Lightning-Flow-Scanner/unit-tests-vscode
unit tests on vsce
2 parents c1adaa8 + 006cc53 commit 0df5c4c

31 files changed

+8402
-5721
lines changed

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,18 @@ concurrency:
1111
jobs:
1212
test:
1313
name: Test
14-
15-
runs-on: ${{ matrix.os }}
16-
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
os: [macos-latest, windows-latest]
21-
node-version: [20.x, 22.x]
22-
14+
runs-on: macos-latest
2315
timeout-minutes: 15
2416
steps:
2517
- name: Checkout Code
2618
uses: actions/checkout@v4
2719
- name: Install node
2820
uses: actions/[email protected]
2921
with:
30-
node-version: 20.x
22+
node-version: 22.x
3123
- name: Install dependencies and link
3224
run: npm ci
3325
- name: Package
3426
run: npm run build
35-
# - name: Run tests
36-
# run: npm run wdio-test
27+
- name: Run tests
28+
run: npm run test:cov

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ node_modules
55
*.vsix
66
.DS_Store
77
yarn-error.logs
8-
.wdio-vscode-service
8+
.wdio-vscode-service
9+
10+
coverage
11+
*.log

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
},
1111
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1212
"typescript.tsc.autoDetect": "off",
13-
"typescript.tsdk": "node_modules/typescript/lib"
13+
"typescript.tsdk": "node_modules/typescript/lib",
14+
"jest.jestCommandLine" : "npm run jest --",
15+
"jest.runMode": "on-demand"
1416
}

.vscodeignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@ vsc-extension-quickstart.md
1010
**/*.ts
1111
node_modules
1212
.wdio-vscode-service
13-
**.vsix
13+
**.vsix
14+
15+
__mocks__
16+
test
17+
coverage
18+
*.log
19+
*.config.mjs
20+
*.config.js
21+
*.conf.ts
22+
.github

__mocks__/vscode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* eslint-disable @typescript-eslint/no-require-imports */
2+
module.exports = require('jest-mock-vscode').createVSCodeMock(jest);

eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2+
import tsParser from '@typescript-eslint/parser';
3+
import tseslint from 'typescript-eslint';
4+
5+
export default [
6+
{
7+
ignores: [
8+
'out/*',
9+
'dist/*',
10+
'node_modules/*',
11+
'.wdio-vscode-service',
12+
'build/*',
13+
'tailwind.config.js',
14+
'test/specs/test.e2e.ts',
15+
'webpack.config.js',
16+
'webviews/globals.d.ts',
17+
],
18+
},
19+
{
20+
plugins: {
21+
'@typescript-eslint': typescriptEslint,
22+
},
23+
24+
languageOptions: {
25+
parser: tsParser,
26+
ecmaVersion: 6,
27+
sourceType: 'module',
28+
},
29+
},
30+
...tseslint.config(tseslint.configs.recommended),
31+
];

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
transform: {
4+
'^.+.tsx?$': ['@swc/jest', { sourceMaps: 'inline' }],
5+
},
6+
testPathIgnorePatterns: ['node_modules/', 'webviews/'],
7+
};

0 commit comments

Comments
 (0)