fix: lint
This commit is contained in:
@@ -2,7 +2,7 @@ import delay from "delay";
|
|||||||
import getPort from "port";
|
import getPort from "port";
|
||||||
import psql, { type Sql } from "postgres";
|
import psql, { type Sql } from "postgres";
|
||||||
|
|
||||||
import { Container } from "../docker/libraries/container.ts";
|
import type { Container } from "../docker/libraries/container.ts";
|
||||||
import { docker } from "../docker/mod.ts";
|
import { docker } from "../docker/mod.ts";
|
||||||
|
|
||||||
export class PostgresTestContainer {
|
export class PostgresTestContainer {
|
||||||
@@ -33,7 +33,7 @@ export class PostgresTestContainer {
|
|||||||
/**
|
/**
|
||||||
* Execute a command in the Postgres container.
|
* Execute a command in the Postgres container.
|
||||||
*/
|
*/
|
||||||
get exec() {
|
get exec(): typeof this.container.exec {
|
||||||
return this.container.exec.bind(this.container);
|
return this.container.exec.bind(this.container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CreateExecOptions, Exec } from "./exec.ts";
|
import { type CreateExecOptions, Exec } from "./exec.ts";
|
||||||
import { modem } from "./modem.ts";
|
import { modem } from "./modem.ts";
|
||||||
|
|
||||||
export class Container {
|
export class Container {
|
||||||
@@ -55,7 +55,7 @@ export class Container {
|
|||||||
*
|
*
|
||||||
* @see https://docs.docker.com/engine/api/v1.45/#tag/Container/operation/ContainerInspect
|
* @see https://docs.docker.com/engine/api/v1.45/#tag/Container/operation/ContainerInspect
|
||||||
*/
|
*/
|
||||||
async inspect() {
|
async inspect(): Promise<Record<string, never>> {
|
||||||
return modem.get({ path: `/containers/${this.id}/json` });
|
return modem.get({ path: `/containers/${this.id}/json` });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ export class Container {
|
|||||||
* @param cmd - Command to run.
|
* @param cmd - Command to run.
|
||||||
* @param opts - Options for the command.
|
* @param opts - Options for the command.
|
||||||
*/
|
*/
|
||||||
async exec(cmd: string | string[], opts: Partial<CreateExecOptions> = {}) {
|
async exec(cmd: string | string[], opts: Partial<CreateExecOptions> = {}): Promise<void> {
|
||||||
const { Id } = await modem.post<{ Id: string }>({
|
const { Id } = await modem.post<{ Id: string }>({
|
||||||
path: `/containers/${this.id}/exec`,
|
path: `/containers/${this.id}/exec`,
|
||||||
body: {
|
body: {
|
||||||
@@ -101,7 +101,7 @@ export class Container {
|
|||||||
AttachStderr: true,
|
AttachStderr: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return new Exec(Id).start();
|
await new Exec(Id).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ContainerConfig } from "../types/container.ts";
|
import type { ContainerConfig } from "../types/container.ts";
|
||||||
import { modem } from "./modem.ts";
|
import { modem } from "./modem.ts";
|
||||||
import { Container } from "./container.ts";
|
import { Container } from "./container.ts";
|
||||||
import { Image } from "./image.ts";
|
import { Image } from "./image.ts";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Request, type RequestMethod } from "./request.ts";
|
import { Request, type RequestMethod } from "./request.ts";
|
||||||
import { type Response } from "./response.ts";
|
import type { Response } from "./response.ts";
|
||||||
|
|
||||||
export class Client {
|
export class Client {
|
||||||
constructor(readonly options: Deno.ConnectOptions | Deno.UnixConnectOptions) {}
|
constructor(readonly options: Deno.ConnectOptions | Deno.UnixConnectOptions) {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { assertArrayIncludes, assertEquals } from "std/assert/mod.ts";
|
import { assertArrayIncludes } from "std/assert/mod.ts";
|
||||||
import { afterAll, describe, it } from "std/testing/bdd.ts";
|
import { afterAll, describe, it } from "std/testing/bdd.ts";
|
||||||
|
|
||||||
import { PostgresTestContainer } from "../containers/postgres.ts";
|
import { PostgresTestContainer } from "../containers/postgres.ts";
|
||||||
|
|||||||
Reference in New Issue
Block a user