feat: midway注解方式编写插件

This commit is contained in:
xiaojunnuo
2023-01-07 23:22:02 +08:00
parent e4ec4e1404
commit 52522f27e9
16 changed files with 156 additions and 238 deletions
+7 -3
View File
@@ -3,10 +3,14 @@ import "mocha";
import { EchoPlugin } from "./echo-plugin";
describe("task_plugin", function () {
it("#taskplugin", function () {
console.log("before new plugin");
const echoPlugin = new EchoPlugin();
console.log("before set property", echoPlugin);
echoPlugin.cert = { test: 1 };
console.log("before execute");
// @ts-ignore
const define = echoPlugin.getDefine();
echoPlugin.execute({ context: {}, input: { test: 111 } });
expect(define.name).eq("EchoPlugin");
echoPlugin.execute();
console.log("after execute");
expect(echoPlugin.cert).eq("EchoPlugin");
});
});