test: relax tailscale binary expectations
This commit is contained in:
@@ -10,6 +10,7 @@ const {
|
|||||||
disableTailscaleServe,
|
disableTailscaleServe,
|
||||||
ensureFunnel,
|
ensureFunnel,
|
||||||
} = tailscale;
|
} = tailscale;
|
||||||
|
const tailscaleBin = expect.stringMatching(/tailscale$/);
|
||||||
|
|
||||||
describe("tailscale helpers", () => {
|
describe("tailscale helpers", () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -75,7 +76,7 @@ describe("tailscale helpers", () => {
|
|||||||
|
|
||||||
expect(exec).toHaveBeenNthCalledWith(
|
expect(exec).toHaveBeenNthCalledWith(
|
||||||
1,
|
1,
|
||||||
"tailscale",
|
tailscaleBin,
|
||||||
expect.arrayContaining(["serve", "--bg", "--yes", "3000"]),
|
expect.arrayContaining(["serve", "--bg", "--yes", "3000"]),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
);
|
);
|
||||||
@@ -83,7 +84,7 @@ describe("tailscale helpers", () => {
|
|||||||
expect(exec).toHaveBeenNthCalledWith(
|
expect(exec).toHaveBeenNthCalledWith(
|
||||||
2,
|
2,
|
||||||
"sudo",
|
"sudo",
|
||||||
expect.arrayContaining(["-n", "tailscale", "serve", "--bg", "--yes", "3000"]),
|
expect.arrayContaining(["-n", tailscaleBin, "serve", "--bg", "--yes", "3000"]),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -96,7 +97,7 @@ describe("tailscale helpers", () => {
|
|||||||
|
|
||||||
expect(exec).toHaveBeenCalledTimes(1);
|
expect(exec).toHaveBeenCalledTimes(1);
|
||||||
expect(exec).toHaveBeenCalledWith(
|
expect(exec).toHaveBeenCalledWith(
|
||||||
"tailscale",
|
tailscaleBin,
|
||||||
expect.arrayContaining(["serve", "--bg", "--yes", "3000"]),
|
expect.arrayContaining(["serve", "--bg", "--yes", "3000"]),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
);
|
);
|
||||||
@@ -115,7 +116,7 @@ describe("tailscale helpers", () => {
|
|||||||
expect(exec).toHaveBeenNthCalledWith(
|
expect(exec).toHaveBeenNthCalledWith(
|
||||||
2,
|
2,
|
||||||
"sudo",
|
"sudo",
|
||||||
expect.arrayContaining(["-n", "tailscale", "serve", "reset"]),
|
expect.arrayContaining(["-n", tailscaleBin, "serve", "reset"]),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -144,14 +145,14 @@ describe("tailscale helpers", () => {
|
|||||||
// 1. status
|
// 1. status
|
||||||
expect(exec).toHaveBeenNthCalledWith(
|
expect(exec).toHaveBeenNthCalledWith(
|
||||||
1,
|
1,
|
||||||
"tailscale",
|
tailscaleBin,
|
||||||
expect.arrayContaining(["funnel", "status", "--json"]),
|
expect.arrayContaining(["funnel", "status", "--json"]),
|
||||||
);
|
);
|
||||||
|
|
||||||
// 2. enable normal
|
// 2. enable normal
|
||||||
expect(exec).toHaveBeenNthCalledWith(
|
expect(exec).toHaveBeenNthCalledWith(
|
||||||
2,
|
2,
|
||||||
"tailscale",
|
tailscaleBin,
|
||||||
expect.arrayContaining(["funnel", "--yes", "--bg", "8080"]),
|
expect.arrayContaining(["funnel", "--yes", "--bg", "8080"]),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
);
|
);
|
||||||
@@ -160,7 +161,7 @@ describe("tailscale helpers", () => {
|
|||||||
expect(exec).toHaveBeenNthCalledWith(
|
expect(exec).toHaveBeenNthCalledWith(
|
||||||
3,
|
3,
|
||||||
"sudo",
|
"sudo",
|
||||||
expect.arrayContaining(["-n", "tailscale", "funnel", "--yes", "--bg", "8080"]),
|
expect.arrayContaining(["-n", tailscaleBin, "funnel", "--yes", "--bg", "8080"]),
|
||||||
expect.any(Object),
|
expect.any(Object),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user