Skip to content

Commit 39f3353

Browse files
committed
fixup! ssh: Add --reason
1 parent 0bec19e commit 39f3353

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/commands/__tests__/__snapshots__/ssh.test.ts.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`ssh ephemeral access should call p0 request with reason arg: args 1`] = `
44
{
5-
"$0": "/Users/nathanbrahms/dev/p0cli/node_modules/.bin/jest",
65
"_": [
76
"ssh",
87
],
@@ -37,7 +36,6 @@ exports[`ssh ephemeral access should call ssm: stderr 1`] = `
3736

3837
exports[`ssh persistent access should call p0 request with reason arg: args 1`] = `
3938
{
40-
"$0": "/Users/nathanbrahms/dev/p0cli/node_modules/.bin/jest",
4139
"_": [
4240
"ssh",
4341
],

src/commands/__tests__/ssh.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { mockGetDoc } from "../../testing/firestore";
1515
import { sleep } from "../../util";
1616
import { sshCommand } from "../ssh";
1717
import { onSnapshot } from "firebase/firestore";
18+
import { omit } from "lodash";
1819
import yargs from "yargs";
1920

2021
jest.mock("../../drivers/api");
@@ -60,7 +61,11 @@ describe("ssh", () => {
6061
it("should call p0 request with reason arg", async () => {
6162
void sshCommand(yargs()).parse(`ssh some-instance --reason reason`);
6263
await sleep(100);
63-
expect(mockFetchCommand.mock.calls[0][1]).toMatchSnapshot("args");
64+
const hiddenFilenameRequestArgs = omit(
65+
mockFetchCommand.mock.calls[0][1],
66+
"$0"
67+
);
68+
expect(hiddenFilenameRequestArgs).toMatchSnapshot("args");
6469
});
6570

6671
it("should wait for access grant", async () => {

0 commit comments

Comments
 (0)