Skip to content

Commit d795340

Browse files
committed
Add tests for path with spaces
1 parent b798028 commit d795340

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,28 @@ describe("Testing certs", function() {
117117
})()
118118
})
119119

120+
it("support path with spaces", function(done) {
121+
// inner async function
122+
(async() => {
123+
// set a custom cert path
124+
process.env.CERT_PATH = "test/custom folder"
125+
// prepare the server with a mock response
126+
app.get("/test/module", (req, res) => res.send("TEST"))
127+
// start the server
128+
await app.listen(HTTPS_PORT)
129+
// make the request and check the output
130+
await makeRequest("/test/module")
131+
.then(res => assert(res.data === "TEST"))
132+
// close the server
133+
app.server.close()
134+
// delete the custom folder
135+
certs.remove(process.env.CERT_PATH)
136+
// restore the CERT_PATH to undefined
137+
delete process.env.CERT_PATH
138+
done()
139+
})()
140+
})
141+
120142
it("provides the certificate", function(done) {
121143
// inner async function
122144
(async() => {

0 commit comments

Comments
 (0)