Skip to content

Commit afeca35

Browse files
committed
Fixup for node:test
1 parent 976aee2 commit afeca35

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/test_plugins.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ describe("plugin resolution", () => {
187187
}));
188188
});
189189

190-
it("balks at invalid package identifiers", () => {
191-
assert.rejects(async () => {
190+
it("balks at invalid package identifiers", async () => {
191+
await assert.rejects(async () => {
192192
return _determinePlugins(["faucet-pipeline-yummy"]);
193193
}, /exit 1/);
194194

195-
assert.rejects(() => {
195+
await assert.rejects(() => {
196196
return _determinePlugins([{
197197
// NB: local configuration must not be comprehensive to ensure
198198
// plugin is loaded
@@ -202,8 +202,8 @@ describe("plugin resolution", () => {
202202
}, /exit 1/);
203203
});
204204

205-
it("balks at duplicate configuration keys", () => {
206-
assert.rejects(() => {
205+
it("balks at duplicate configuration keys", async () => {
206+
await assert.rejects(() => {
207207
return _determinePlugins([{
208208
key: "dummy",
209209
bucket: "static",
@@ -216,35 +216,35 @@ describe("plugin resolution", () => {
216216
}, /exit 1/);
217217
});
218218

219-
it("balks at invalid plugins", () => {
220-
assert.rejects(() => {
219+
it("balks at invalid plugins", async () => {
220+
await assert.rejects(() => {
221221
return _determinePlugins(["faucet-pipeline-invalid-a"]);
222222
}, /exit 1/);
223223

224-
assert.rejects(() => {
224+
await assert.rejects(() => {
225225
return _determinePlugins(["faucet-pipeline-invalid-b"]);
226226
}, /exit 1/);
227227

228-
assert.rejects(() => {
228+
await assert.rejects(() => {
229229
return _determinePlugins(["faucet-pipeline-invalid-c"]);
230230
}, /exit 1/);
231231
});
232232

233-
// FIXME: unhandled promise rejection
234-
it.skip("balks at invalid buckets", () => {
233+
it("balks at invalid buckets", async () => {
235234
let plugin = {
236235
key: "dummy",
237236
plugin: () => {}
238237
};
239-
["static", "scripts", "styles", "markup"].forEach(bucket => {
238+
const buckets = ["static", "scripts", "styles", "markup"];
239+
for(let bucket of buckets) {
240240
plugin.bucket = bucket;
241-
assert.doesNotReject(() => {
241+
await assert.doesNotReject(async () => {
242242
return _determinePlugins([plugin]);
243243
}, /exit 1/);
244-
});
244+
}
245245

246246
plugin.bucket = "dummy";
247-
assert.rejects(() => {
247+
await assert.rejects(async () => {
248248
return _determinePlugins([plugin]);
249249
}, /exit 1/);
250250
});

0 commit comments

Comments
 (0)