@@ -20,7 +20,7 @@ it("creates a new file and adds the config", async () => {
2020 const sshConfig = new SSHConfig ( sshFilePath , mockFileSystem )
2121 await sshConfig . load ( )
2222 await sshConfig . update ( {
23- Host : "coder-- vscode--*" ,
23+ Host : "coder-vscode--*" ,
2424 ProxyCommand : "some-command-here" ,
2525 ConnectTimeout : "0" ,
2626 StrictHostKeyChecking : "no" ,
@@ -29,7 +29,7 @@ it("creates a new file and adds the config", async () => {
2929 } )
3030
3131 const expectedOutput = `# --- START CODER VSCODE ---
32- Host coder-- vscode--*
32+ Host coder-vscode--*
3333 ProxyCommand some-command-here
3434 ConnectTimeout 0
3535 StrictHostKeyChecking no
@@ -54,7 +54,7 @@ it("adds a new coder config in an existent SSH configuration", async () => {
5454 const sshConfig = new SSHConfig ( sshFilePath , mockFileSystem )
5555 await sshConfig . load ( )
5656 await sshConfig . update ( {
57- Host : "coder-- vscode--*" ,
57+ Host : "coder-vscode--*" ,
5858 ProxyCommand : "some-command-here" ,
5959 ConnectTimeout : "0" ,
6060 StrictHostKeyChecking : "no" ,
@@ -65,7 +65,7 @@ it("adds a new coder config in an existent SSH configuration", async () => {
6565 const expectedOutput = `${ existentSSHConfig }
6666
6767# --- START CODER VSCODE ---
68- Host coder-- vscode--*
68+ Host coder-vscode--*
6969 ProxyCommand some-command-here
7070 ConnectTimeout 0
7171 StrictHostKeyChecking no
@@ -89,7 +89,7 @@ it("updates an existent coder config", async () => {
8989 ProxyCommand command
9090
9191# --- START CODER VSCODE ---
92- Host coder-- vscode--*
92+ Host coder-vscode--*
9393 ProxyCommand some-command-here
9494 ConnectTimeout 0
9595 StrictHostKeyChecking no
@@ -133,7 +133,7 @@ Host coder--updated--vscode--*
133133} )
134134
135135it ( "removes old coder SSH config and adds the new one" , async ( ) => {
136- const existentSSHConfig = `Host coder-- vscode--*
136+ const existentSSHConfig = `Host coder-vscode--*
137137 HostName coder.something
138138 ConnectTimeout=0
139139 StrictHostKeyChecking=no
@@ -145,7 +145,7 @@ it("removes old coder SSH config and adds the new one", async () => {
145145 const sshConfig = new SSHConfig ( sshFilePath , mockFileSystem )
146146 await sshConfig . load ( )
147147 await sshConfig . update ( {
148- Host : "coder-- vscode--*" ,
148+ Host : "coder-vscode--*" ,
149149 ProxyCommand : "some-command-here" ,
150150 ConnectTimeout : "0" ,
151151 StrictHostKeyChecking : "no" ,
@@ -154,14 +154,16 @@ it("removes old coder SSH config and adds the new one", async () => {
154154 } )
155155
156156 const expectedOutput = `# --- START CODER VSCODE ---
157- Host coder-- vscode--*
157+ Host coder-vscode--*
158158 ProxyCommand some-command-here
159159 ConnectTimeout 0
160160 StrictHostKeyChecking no
161161 UserKnownHostsFile /dev/null
162162 LogLevel ERROR
163163# --- END CODER VSCODE ---`
164164
165+ console . log ( sshConfig . getRaw ( ) )
166+
165167 expect ( mockFileSystem . writeFile ) . toBeCalledWith ( sshFilePath , expectedOutput , {
166168 encoding : "utf-8" ,
167169 mode : 384 ,
0 commit comments