-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Task] #35 refactor build to run jest tests
- Loading branch information
1 parent
1f34521
commit 4d11814
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import axios from 'axios'; | ||
|
||
describe('Server Status', () => { | ||
it('The server is running', async () => { | ||
var serverStatus; | ||
try { | ||
const response = await axios.get('http://localhost'); | ||
Check notice Code scanning / devskim Accessing localhost could indicate debug code, or could hinder scaling. Note
Do not leave debug code in production
|
||
serverStatus = response.status; | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
|
||
expect(serverStatus).toBe(200); | ||
}) | ||
}) |