mirror of
https://github.com/certd/certd.git
synced 2026-05-18 06:17:31 +08:00
feat: midway注解方式编写插件
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user