Skip to content

Commit 3d30cc2

Browse files
committed
Test improved
1 parent 17a8e74 commit 3d30cc2

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

.travis.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,4 @@ node_js:
9494
- 7.7.1
9595
- 7.7.0
9696
- 7.6
97-
- 7.5
98-
- 7.4
99-
- 7.3
100-
- 7.2.1
101-
- 7.2.0
102-
- 7.1
103-
- 7.0
10497
after_success: npm run coveralls

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ Checkout the updated list [here](https://github.com/FiloSottile/mkcert/blob/mast
6767
- Java (when `JAVA_HOME` is set)
6868

6969

70+
## Troubleshooting
71+
https-localhost requires Node.js 7.6 or higher.
72+
<small>If you need compatibility with previously Node.js versions let me know, I'll try to rearrange the code.</small>
73+
7074
## License
7175
Is released under [AGPL-3.0 - GNU Affero General Public License v3.0](LICENSE).
7276

test/test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,22 @@ describe("Testing https-localhost", () => {
8080
res.data.toString() === fs.readFileSync("test/static.html").toString()))
8181
})
8282

83+
it("doesn't crash on 404", async function() {
84+
// start the server (serving the default folder)
85+
app.serve()
86+
// make the request and check the status code
87+
await makeRequest("/do-not-exist")
88+
.then(res => assert(res.statusCode === 404))
89+
})
90+
91+
it("doesn't crash if the static path doesn't exists", async function() {
92+
// start the server (serving a non existing folder)
93+
app.serve("do-not-exists")
94+
// make the request and check the status code
95+
await makeRequest("/")
96+
.then(res => assert(res.statusCode === 404))
97+
})
98+
8399
it("redirect http to https", async function() {
84100
// start the redirection
85101
await app.redirect(HTTP_PORT)

0 commit comments

Comments
 (0)