Skip to content

Commit 76ad706

Browse files
committed
[bug]:fix get vendor failed
1 parent acb0f7f commit 76ad706

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

docs/dev/test.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@ The test of the project is based on the `Vitest` framework. Get more information
66

77
All test code is located in the `test` directory. The test code is written in `TypeScript` and uses the `Vitest` framework to run the test.
88

9-
## Run Test
9+
## Run Specific Test File
10+
11+
```bash
12+
npx vitest test/docan/candle.test.ts
13+
```
14+
15+
## Run Specific Test Case with pattern
1016

11-
To run the test, you can use the following command:
17+
```bash
18+
npx vitest test/docan/candle.test.ts --t "test name"
19+
```
20+
21+
## Run Test
1222

1323
```bash
1424
npm run test

src/main/ipc/index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,22 @@ ipcMain.handle('ipc-get-vendor', (event, arg) => {
7171
const input = arg as EcuBusPro
7272
const vendors = input.vendor[platform] || []
7373
return vendors.map((vendor) => {
74+
let linVersion = 'unknown'
75+
try {
76+
linVersion = getLinVersion(vendor)
77+
} catch (e: any) {
78+
//null
79+
}
80+
let canVersion = 'unknown'
81+
try {
82+
canVersion = getCanVersion(vendor)
83+
} catch (e: any) {
84+
//null
85+
}
7486
return {
7587
name: vendor,
76-
can: getCanVersion(vendor),
77-
lin: getLinVersion(vendor)
88+
can: canVersion,
89+
lin: linVersion
7890
}
7991
})
8092
})

0 commit comments

Comments
 (0)