Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v3' into review-local-help
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Dec 13, 2024
2 parents bc82fa1 + 2f32803 commit 308a209
Show file tree
Hide file tree
Showing 8 changed files with 479 additions and 89 deletions.
4 changes: 4 additions & 0 deletions src/commands/local.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ async function startLocal(argv) {
await ensureContainerRunning({
imageName: argv.image,
containerName: argv.name,
hostIp: argv.hostIp,
hostPort: argv.hostPort,
containerPort: argv.containerPort,
pull: argv.pull,
interval: argv.interval,
maxAttempts: argv.maxAttempts,
color: argv.color,
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/config/setup-container.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from "node:fs";
import * as fsp from "node:fs/promises";
import net from "node:net";
import os from "node:os";
import path from "node:path";
import { exit } from "node:process";
Expand Down Expand Up @@ -60,6 +61,7 @@ export const injectables = {
fetch: awilix.asValue(fetchWrapper),
fs: awilix.asValue(fs),
fsp: awilix.asValue(fsp),
net: awilix.asValue(net),
dirname: awilix.asValue(path.dirname),
normalize: awilix.asValue(path.normalize),
homedir: awilix.asValue(os.homedir),
Expand Down
3 changes: 3 additions & 0 deletions src/config/setup-test-container.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "node:fs";
import net from "node:net";
import path from "node:path";
import { PassThrough } from "node:stream";

Expand Down Expand Up @@ -43,6 +44,7 @@ export function setupTestContainer() {

const thingsToManuallyMock = automock(container);
const customfs = stub({ ...fs });
const customNet = stub({ ...net });
// this is a mock used by the default profile behavior
customfs.readdirSync.withArgs(process.cwd()).returns([]);

Expand All @@ -58,6 +60,7 @@ export function setupTestContainer() {
// real implementation
parseYargs: awilix.asValue(spy(parseYargs)),
fs: awilix.asValue(customfs),
net: awilix.asValue(customNet),
homedir: awilix.asValue(
stub().returns(path.join(__dirname, "../../test/test-homedir")),
),
Expand Down
Loading

0 comments on commit 308a209

Please sign in to comment.