Skip to content

Commit de6072b

Browse files
v-czgv-czg
v-czg
authored and
v-czg
committed
improve the test cases
1 parent f1dad52 commit de6072b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/boardmanager.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as assert from "assert";
22
import * as fs from "fs";
3-
import * as os from "os";
3+
44
import * as Path from "path";
55
import * as TypeMoq from "typemoq";
66

@@ -112,7 +112,7 @@ suite("Arduino: Board Manager.", () => {
112112
if (util.directoryExistsSync(packagePath)) {
113113
done();
114114
} else {
115-
done(new Error("esp8266 board package install failure, can't find package path :" + packagePath));
115+
done(new Error("Microsoft board package install failure, can't find package path :" + packagePath));
116116
}
117117
});
118118

@@ -130,7 +130,9 @@ suite("Arduino: Board Manager.", () => {
130130
const packagePath = Path.join(arduinoSettings.packagePath, "packages", "Microsoft");
131131
if (util.directoryExistsSync(packagePath)) {
132132
ArduinoContext.arduinoApp.uninstallBoard("Microsoft", packagePath);
133-
133+
if (util.directoryExistsSync(packagePath)) {
134+
assert.fail(true, false, "Package path still exist after calling uninstall package,remove the board package failure", "");
135+
}
134136
}
135137
} catch (error) {
136138
assert.fail(true, false, new Error(error).message, new Error(error).name);

test/librarymanager.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ suite("Arduino: Library Manager.", () => {
9898

9999
if (util.directoryExistsSync(libPath)) {
100100
ArduinoContext.arduinoApp.uninstallLibrary("AzureIoTHub", libPath);
101+
if (util.directoryExistsSync(libPath)) {
102+
assert.fail(true, false, "Library path still exist after calling uninstall library,remove the library failure", "");
103+
}
101104
}
102105

103106
} catch (error) {

0 commit comments

Comments
 (0)