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.
This commit is contained in:
Robin Malfait 2021-09-04 16:33:55 +02:00 committed by GitHub
parent c315db5f15
commit 2dac5bb569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1895 additions and 1 deletions

View File

@ -499,7 +499,7 @@ function registerPlugins(plugins, context) {
pluginItem(pluginApi)
}
} else {
plugin(pluginApi)
plugin?.(pluginApi)
}
}

1894
tests/custom-plugins.test.js Normal file

File diff suppressed because it is too large Load Diff