Skip to content

Commit 6c438bb

Browse files
committed
Add additional test
1 parent 8285967 commit 6c438bb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/execute-baseurl.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,15 @@ describe('baseUrl', () => {
123123

124124
expect(res).toEqual("https://foo.com:8080")
125125
})
126+
127+
it('should default to HTTPS scheme and host based on the contextUrl', () => {
128+
const res = baseUrl({
129+
spec: {
130+
title: 'a spec'
131+
},
132+
contextUrl: "https://example.com:9090/hello/swagger.json"
133+
})
134+
135+
expect(res).toEqual("https://example.com:9090")
136+
})
126137
})

0 commit comments

Comments
 (0)