Skip to content

Commit

Permalink
Add custom plugins tests (#5383)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
RobinMalfait authored Sep 4, 2021
1 parent c315db5 commit 2dac5bb
Show file tree
Hide file tree
Showing 2 changed files with 1,895 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/setupContextUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ function registerPlugins(plugins, context) {
pluginItem(pluginApi)
}
} else {
plugin(pluginApi)
plugin?.(pluginApi)
}
}

Expand Down
Loading

0 comments on commit 2dac5bb

Please sign in to comment.