mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-13 03:50:02 -04:00
tidy
This commit is contained in:
parent
e2fd72b8ba
commit
0cb7f38f20
35 changed files with 1722 additions and 1058 deletions
28
test.js
28
test.js
|
@ -1,19 +1,21 @@
|
|||
const axios = require('axios');
|
||||
const axios = require("axios");
|
||||
|
||||
async function testServerResponse() {
|
||||
try {
|
||||
const response = await axios.get('http://localhost:8080/?pathtonowhere');
|
||||
if (response.status === 200) {
|
||||
console.log('Server responded with status code 200. Test passed.');
|
||||
process.exit(0); // Exit with success
|
||||
} else {
|
||||
console.error(`Expected status code 200 but received ${response.status}. Test failed.`);
|
||||
process.exit(1); // Exit with failure
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error while testing server response:', error.message);
|
||||
process.exit(1); // Exit with failure
|
||||
try {
|
||||
const response = await axios.get("http://localhost:8080/?pathtonowhere");
|
||||
if (response.status === 200) {
|
||||
console.log("Server responded with status code 200. Test passed.");
|
||||
process.exit(0); // Exit with success
|
||||
} else {
|
||||
console.error(
|
||||
`Expected status code 200 but received ${response.status}. Test failed.`
|
||||
);
|
||||
process.exit(1); // Exit with failure
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error while testing server response:", error.message);
|
||||
process.exit(1); // Exit with failure
|
||||
}
|
||||
}
|
||||
|
||||
testServerResponse();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue