mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
fix: plugin related tests
This commit is contained in:
@@ -20,7 +20,7 @@ import {suite, test, timeout} from '@testdeck/mocha';
|
||||
import {HttpClient} from '../src/http-client';
|
||||
import {HttpClientResponse} from '../src/http-client-interface';
|
||||
import {PluginClient} from '../src/plugin-client';
|
||||
import {TestPlugin} from './TestPlugin';
|
||||
import {TestPlugin} from './plugin-resources/test-plugin';
|
||||
|
||||
chai.use(chaiSpies);
|
||||
|
||||
|
||||
25
test/plugin-resources/test-plugin-response.ts
Normal file
25
test/plugin-resources/test-plugin-response.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2021 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* The Response Interface
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface TestPluginResponse {
|
||||
/**
|
||||
* Query dummy
|
||||
*/
|
||||
query: string;
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import * as express from 'express';
|
||||
import {Plugin} from '../src/plugin';
|
||||
import {Plugin} from '../../src/plugin';
|
||||
|
||||
/**
|
||||
* A test plugin we use for all the tests
|
||||
@@ -23,8 +23,10 @@ import {Plugin} from '../src/plugin';
|
||||
* It also serves as kind of a minimal plugin
|
||||
*/
|
||||
export class TestPlugin extends Plugin {
|
||||
// tslint:disable-next-line: completed-docs prefer-function-over-method
|
||||
protected async onRouteInvoke(_req: express.Request, res: express.Response): Promise<void> {
|
||||
res.json({});
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import {readFileSync} from 'fs';
|
||||
import {suite, test, timeout} from '@testdeck/mocha';
|
||||
import {resolve} from 'path';
|
||||
import {HttpClient} from '../src/http-client';
|
||||
import {TestPlugin} from './TestPlugin';
|
||||
import {TestPlugin} from './plugin-resources/test-plugin';
|
||||
|
||||
chai.use(chaiSpies);
|
||||
|
||||
@@ -54,7 +54,7 @@ export class PluginSpec {
|
||||
|
||||
@test
|
||||
async construct() {
|
||||
const converter = new Converter(__dirname);
|
||||
const converter = new Converter(__dirname, resolve(__dirname,'plugin-resources','test-plugin-response.ts'));
|
||||
|
||||
sandbox.on(converter, 'getSchema', (schemaName) => {
|
||||
return {$id: schemaName};
|
||||
|
||||
Reference in New Issue
Block a user