Skip to content

Commit a48fc8d

Browse files
committed
updated test to include test for empty uri
1 parent f7a947f commit a48fc8d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ describe("Call test endpoint", () => {
5252
&& expect(obj.hiddengames[0]).to.equal("Tic-Tac-Toe")
5353
})
5454

55+
it('Passing host and path and an empty uri results in success with a hidden game listed', async () => {
56+
let req = new tools.APIRequest({host: 'api.chadkluck.net', path: '/games/', uri: ''})
57+
const result = await req.send()
58+
const obj = JSON.parse(result.body);
59+
expect(result.statusCode).to.equal(200)
60+
&& expect(result.success).to.equal(true)
61+
&& expect((typeof result.headers)).to.equal('object')
62+
&& expect(result.message).to.equal("SUCCESS")
63+
&& expect(obj.hiddengames.length).to.equal(1)
64+
&& expect(obj.hiddengames[0]).to.equal("Tic-Tac-Toe")
65+
})
66+
5567
it('Passing uri results in 404', async () => {
5668
let req = new tools.APIRequest({uri: 'https://api.chadkluck.net/games2-waf/'})
5769
const result = await req.send()

0 commit comments

Comments
 (0)