1- /* global describe, before, after, it */
21"use strict" ;
32
43let { pluginsByBucket, _determinePlugins } = require ( "../lib/plugins" ) ;
4+ let { describe, it, before, after } = require ( "node:test" ) ;
55let path = require ( "path" ) ;
66let assert = require ( "assert" ) ;
77
@@ -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 } , / e x i t 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 } , / e x i t 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,34 +216,35 @@ describe("plugin resolution", () => {
216216 } , / e x i t 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 } , / e x i t 1 / ) ;
223223
224- assert . rejects ( ( ) => {
224+ await assert . rejects ( ( ) => {
225225 return _determinePlugins ( [ "faucet-pipeline-invalid-b" ] ) ;
226226 } , / e x i t 1 / ) ;
227227
228- assert . rejects ( ( ) => {
228+ await assert . rejects ( ( ) => {
229229 return _determinePlugins ( [ "faucet-pipeline-invalid-c" ] ) ;
230230 } , / e x i t 1 / ) ;
231231 } ) ;
232232
233- it ( "balks at invalid buckets" , ( ) => {
233+ it ( "balks at invalid buckets" , async ( ) => {
234234 let plugin = {
235235 key : "dummy" ,
236236 plugin : ( ) => { }
237237 } ;
238- [ "static" , "scripts" , "styles" , "markup" ] . forEach ( bucket => {
238+ const buckets = [ "static" , "scripts" , "styles" , "markup" ] ;
239+ for ( let bucket of buckets ) {
239240 plugin . bucket = bucket ;
240- assert . doesNotReject ( ( ) => {
241+ await assert . doesNotReject ( async ( ) => {
241242 return _determinePlugins ( [ plugin ] ) ;
242243 } , / e x i t 1 / ) ;
243- } ) ;
244+ }
244245
245246 plugin . bucket = "dummy" ;
246- assert . rejects ( ( ) => {
247+ await assert . rejects ( async ( ) => {
247248 return _determinePlugins ( [ plugin ] ) ;
248249 } , / e x i t 1 / ) ;
249250 } ) ;
0 commit comments