Skip to content

Commit

Permalink
feat(core): separate open() and connect() constructors
Browse files Browse the repository at this point in the history
I thought it is nicer since we also have getOpen() and getConnect() (and fetch*
variants).
  • Loading branch information
denizenging committed Oct 17, 2023
1 parent b822da6 commit 32f99d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions pkg/core/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {});
}

Check warning on line 253 in pkg/core/src/plugin.ts

View check run for this annotation

Codecov / codecov/patch

pkg/core/src/plugin.ts#L252-L253

Added lines #L252 - L253 were not covered by tests

/**
* @constructor
*/
static connect(connect: string | string[]) {
return new this(connect, {});
}


/**
* @constructor
*/
Expand Down
2 changes: 1 addition & 1 deletion pkg/http/test/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 32f99d8

Please sign in to comment.