Skip to content

Commit 2dac5bb

Browse files
authored
Add custom plugins tests (#5383)
* add tests for the plugin API * make plugin invocation optional It could be that an object has been passed as a plugin, in that case we will use the `handler` function from the object. If it doesn't exist, then we will only take the `config` section out of it.
1 parent c315db5 commit 2dac5bb

File tree

2 files changed

+1895
-1
lines changed

2 files changed

+1895
-1
lines changed

src/lib/setupContextUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ function registerPlugins(plugins, context) {
499499
pluginItem(pluginApi)
500500
}
501501
} else {
502-
plugin(pluginApi)
502+
plugin?.(pluginApi)
503503
}
504504
}
505505

0 commit comments

Comments
 (0)