frontend-plugin-api: add tests for generator factories + error on undeclared output

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-08-02 14:56:17 +02:00
parent f13b6c467b
commit 5020910446
4 changed files with 150 additions and 4 deletions
@@ -914,7 +914,7 @@ describe('instantiateAppNodeTree', () => {
namespace: 'app',
name: 'test',
attachTo: { id: 'ignored', input: 'ignored' },
output: [],
output: [testDataRef],
factory() {
const error = new Error('NOPE');
error.name = 'NopeError';
@@ -981,11 +981,12 @@ describe('instantiateAppNodeTree', () => {
createAppNodeInstance({
node: makeNode(
resolveExtensionDefinition(
// @ts-expect-error
createExtension({
namespace: 'app',
name: 'test',
attachTo: { id: 'ignored', input: 'ignored' },
output: [],
output: [], // Output not declared
factory({}) {
return [testDataRef('test')] as any;
},