@@ -10,6 +10,7 @@ const {
1010 disableTailscaleServe,
1111 ensureFunnel,
1212} = tailscale ;
13+ const tailscaleBin = expect . stringMatching ( / t a i l s c a l e $ / ) ;
1314
1415describe ( "tailscale helpers" , ( ) => {
1516 afterEach ( ( ) => {
@@ -75,15 +76,15 @@ describe("tailscale helpers", () => {
7576
7677 expect ( exec ) . toHaveBeenNthCalledWith (
7778 1 ,
78- "tailscale" ,
79+ tailscaleBin ,
7980 expect . arrayContaining ( [ "serve" , "--bg" , "--yes" , "3000" ] ) ,
8081 expect . any ( Object ) ,
8182 ) ;
8283
8384 expect ( exec ) . toHaveBeenNthCalledWith (
8485 2 ,
8586 "sudo" ,
86- expect . arrayContaining ( [ "-n" , "tailscale" , "serve" , "--bg" , "--yes" , "3000" ] ) ,
87+ expect . arrayContaining ( [ "-n" , tailscaleBin , "serve" , "--bg" , "--yes" , "3000" ] ) ,
8788 expect . any ( Object ) ,
8889 ) ;
8990 } ) ;
@@ -96,7 +97,7 @@ describe("tailscale helpers", () => {
9697
9798 expect ( exec ) . toHaveBeenCalledTimes ( 1 ) ;
9899 expect ( exec ) . toHaveBeenCalledWith (
99- "tailscale" ,
100+ tailscaleBin ,
100101 expect . arrayContaining ( [ "serve" , "--bg" , "--yes" , "3000" ] ) ,
101102 expect . any ( Object ) ,
102103 ) ;
@@ -115,7 +116,7 @@ describe("tailscale helpers", () => {
115116 expect ( exec ) . toHaveBeenNthCalledWith (
116117 2 ,
117118 "sudo" ,
118- expect . arrayContaining ( [ "-n" , "tailscale" , "serve" , "reset" ] ) ,
119+ expect . arrayContaining ( [ "-n" , tailscaleBin , "serve" , "reset" ] ) ,
119120 expect . any ( Object ) ,
120121 ) ;
121122 } ) ;
@@ -144,14 +145,14 @@ describe("tailscale helpers", () => {
144145 // 1. status
145146 expect ( exec ) . toHaveBeenNthCalledWith (
146147 1 ,
147- "tailscale" ,
148+ tailscaleBin ,
148149 expect . arrayContaining ( [ "funnel" , "status" , "--json" ] ) ,
149150 ) ;
150151
151152 // 2. enable normal
152153 expect ( exec ) . toHaveBeenNthCalledWith (
153154 2 ,
154- "tailscale" ,
155+ tailscaleBin ,
155156 expect . arrayContaining ( [ "funnel" , "--yes" , "--bg" , "8080" ] ) ,
156157 expect . any ( Object ) ,
157158 ) ;
@@ -160,7 +161,7 @@ describe("tailscale helpers", () => {
160161 expect ( exec ) . toHaveBeenNthCalledWith (
161162 3 ,
162163 "sudo" ,
163- expect . arrayContaining ( [ "-n" , "tailscale" , "funnel" , "--yes" , "--bg" , "8080" ] ) ,
164+ expect . arrayContaining ( [ "-n" , tailscaleBin , "funnel" , "--yes" , "--bg" , "8080" ] ) ,
164165 expect . any ( Object ) ,
165166 ) ;
166167 } ) ;
0 commit comments