Skip to content

Commit 0885119

Browse files
committed
🐛 Fix error log message
1 parent bcc88ca commit 0885119

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

denops/@denops-private/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Plugin {
149149
await mod.main(this.#denops);
150150
await emit(this.#denops, `DenopsSystemPluginPost:${this.name}`);
151151
} catch (e) {
152-
console.error(`Failed to load plguin '${this.name}': ${e}`);
152+
console.error(`Failed to load plugin '${this.name}': ${e}`);
153153
await emit(this.#denops, `DenopsSystemPluginFail:${this.name}`);
154154
}
155155
}

denops/@denops-private/service_test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,16 @@ Deno.test("Service", async (t) => {
112112
await t.step(
113113
"load() loads plugin and emits autocmd events (failure)",
114114
async () => {
115+
const c = stub(console, "error");
115116
const s = stub(host, "call");
116117
try {
117118
await service.load("dummyFail", scriptInvalid);
119+
assertSpyCalls(c, 1);
120+
assertSpyCall(c, 0, {
121+
args: [
122+
"Failed to load plugin 'dummyFail': Error: This is dummy error",
123+
],
124+
});
118125
assertSpyCalls(s, 2);
119126
assertSpyCall(s, 0, {
120127
args: [
@@ -132,6 +139,7 @@ Deno.test("Service", async (t) => {
132139
});
133140
} finally {
134141
s.restore();
142+
c.restore();
135143
}
136144
},
137145
);

0 commit comments

Comments
 (0)