Skip to content

Commit 2b61cec

Browse files
fix(test): don't run real request on test
1 parent b8a1bf8 commit 2b61cec

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

spec/client/curl/cli_spec.lua

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -127,58 +127,58 @@ describe("curl cli response parser", function()
127127
end)
128128
end)
129129

130-
-- don't run real request on test by default
131-
describe("curl cli request", function()
132-
nio.tests.it("basic GET request", function()
133-
local response = curl
134-
.request({
135-
context = Context:new(),
136-
url = "https://reqres.in/api/users?page=5",
137-
handlers = {},
138-
headers = {},
139-
cookies = {},
140-
method = "GET",
141-
})
142-
.wait()
143-
assert.same(
144-
'{"page":5,"per_page":6,"total":12,"total_pages":2,"data":[],"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}}',
145-
response.body
146-
)
147-
assert.same({
148-
version = "HTTP/2",
149-
code = 200,
150-
text = ""
151-
}, response.status)
152-
-- HACK: have no idea how to make sure it is table<string,string>
153-
assert.are_table(response.headers)
154-
end)
155-
nio.tests.it("basic POST request", function()
156-
local response = curl
157-
.request({
158-
context = Context:new(),
159-
url = "https://reqres.in/api/register",
160-
handlers = {},
161-
headers = {
162-
["content-type"] = { "application/json" }
163-
},
164-
cookies = {},
165-
method = "POST",
166-
body = {
167-
__TYPE = "json",
168-
data = '{ "email": "eve.holt@reqres.in", "password": "pistol" }',
169-
}
170-
})
171-
.wait()
172-
assert.same(
173-
'{"id":4,"token":"QpwL5tke4Pnpja7X4"}',
174-
response.body
175-
)
176-
assert.same({
177-
version = "HTTP/2",
178-
code = 200,
179-
text = ""
180-
}, response.status)
181-
-- HACK: have no idea how to make sure it is table<string,string>
182-
assert.are_table(response.headers)
183-
end)
184-
end)
130+
-- -- don't run real request on test by default
131+
-- describe("curl cli request", function()
132+
-- nio.tests.it("basic GET request", function()
133+
-- local response = curl
134+
-- .request({
135+
-- context = Context:new(),
136+
-- url = "https://reqres.in/api/users?page=5",
137+
-- handlers = {},
138+
-- headers = {},
139+
-- cookies = {},
140+
-- method = "GET",
141+
-- })
142+
-- .wait()
143+
-- assert.same(
144+
-- '{"page":5,"per_page":6,"total":12,"total_pages":2,"data":[],"support":{"url":"https://reqres.in/#support-heading","text":"To keep ReqRes free, contributions towards server costs are appreciated!"}}',
145+
-- response.body
146+
-- )
147+
-- assert.same({
148+
-- version = "HTTP/2",
149+
-- code = 200,
150+
-- text = ""
151+
-- }, response.status)
152+
-- -- HACK: have no idea how to make sure it is table<string,string>
153+
-- assert.are_table(response.headers)
154+
-- end)
155+
-- nio.tests.it("basic POST request", function()
156+
-- local response = curl
157+
-- .request({
158+
-- context = Context:new(),
159+
-- url = "https://reqres.in/api/register",
160+
-- handlers = {},
161+
-- headers = {
162+
-- ["content-type"] = { "application/json" }
163+
-- },
164+
-- cookies = {},
165+
-- method = "POST",
166+
-- body = {
167+
-- __TYPE = "json",
168+
-- data = '{ "email": "eve.holt@reqres.in", "password": "pistol" }',
169+
-- }
170+
-- })
171+
-- .wait()
172+
-- assert.same(
173+
-- '{"id":4,"token":"QpwL5tke4Pnpja7X4"}',
174+
-- response.body
175+
-- )
176+
-- assert.same({
177+
-- version = "HTTP/2",
178+
-- code = 200,
179+
-- text = ""
180+
-- }, response.status)
181+
-- -- HACK: have no idea how to make sure it is table<string,string>
182+
-- assert.are_table(response.headers)
183+
-- end)
184+
-- end)

0 commit comments

Comments
 (0)