Definition at line 122 of file LoopbackTestRunner.h.
123 {
124 FL_WARN(
"[LOOPBACK] Running test: " << name <<
" -> " << url);
125 Serial.print(
"Running test: ");
127
129
130
132 .then([this, expected, next_state](const fl::net::http::Response& resp) {
133
134 if (resp.
status() == 200 && resp.
text() == expected) {
136 Serial.println(
" ✓ PASSED");
137 } else {
139 Serial.print(
" ✗ FAILED - ");
140 if (resp.
status() != 200) {
143 } else {
144 Serial.print(
"Expected: '");
146 Serial.print(
"', Got: '");
149 }
151 }
152
153
155 })
156 .catch_([this](const fl::task::Error& err) {
157
159 Serial.print(
" ✗ FAILED - Error: ");
161
162
164 });
165
166
168 }
const char * c_str() const FL_NOEXCEPT
const fl::string & text() const
Response body as text (like JavaScript response.text())
int status() const
HTTP status code (like JavaScript response.status)
fl::task::Promise< Response > fetch_get(const fl::string &url, const FetchOptions &request)
HTTP GET request.
References fl::basic_string::c_str(), COMPLETED, fl::net::http::fetch_get(), FL_WARN, has_failure, fl::task::Error::message, Serial, state, fl::net::http::Response::status(), tests_passed, tests_run, and fl::net::http::Response::text().
Referenced by update().