From 32f99d8ee2dbb40151ad27aeea4f135f785d85b4 Mon Sep 17 00:00:00 2001 From: srfsh Date: Tue, 17 Oct 2023 14:40:46 +0300 Subject: [PATCH] feat(core): separate open() and connect() constructors I thought it is nicer since we also have getOpen() and getConnect() (and fetch* variants). --- pkg/core/src/plugin.ts | 12 ++++++++++-- pkg/http/test/plugins.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkg/core/src/plugin.ts b/pkg/core/src/plugin.ts index 4e763241..440f8cef 100644 --- a/pkg/core/src/plugin.ts +++ b/pkg/core/src/plugin.ts @@ -248,10 +248,18 @@ export class PluginContextTest implements PluginContext { /** * @constructor */ - static openconnect(openconnect: string | string[]) { - return new this(openconnect, {}); + static open(open: string | string[]) { + return new this(open, {}); } + /** + * @constructor + */ + static connect(connect: string | string[]) { + return new this(connect, {}); + } + + /** * @constructor */ diff --git a/pkg/http/test/plugins.ts b/pkg/http/test/plugins.ts index 54d60a18..a15003a7 100644 --- a/pkg/http/test/plugins.ts +++ b/pkg/http/test/plugins.ts @@ -40,7 +40,7 @@ test('Simple GET', async (t) => { return; } - const ctx = PluginContextTest.openconnect('http://localhost/normaljson'); + const ctx = PluginContextTest.connect('http://localhost/normaljson'); const res = await execute(ctx, ast.kind, ast.method); t.deepEqual(res, { ok: true,