mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-21 16:52:00 -07:00
33 lines
944 B
JavaScript
33 lines
944 B
JavaScript
/*
|
|
Liveness test runs before all other tests to ensure the server is running.
|
|
*/
|
|
|
|
// Public npm libraries
|
|
import { assert } from 'chai'
|
|
|
|
import axios from 'axios'
|
|
|
|
// const sinon = require('sinon')
|
|
|
|
// Local support libraries
|
|
import config from '../../../config/index.js'
|
|
// import Server from '../../../bin/server.js'
|
|
// import testUtils from '../../utils/test-utils.js'
|
|
// const adminLib = new AdminLib()
|
|
|
|
const LOCALHOST = `http://localhost:${config.port}`
|
|
|
|
describe('#Check Server Liveness', () => {
|
|
// before(async () => {
|
|
it('should confirm the server is running', async () => {
|
|
try {
|
|
const response = await axios.get(`${LOCALHOST}/`)
|
|
assert(response.status === 200, 'Server is running, continuing with E2E tests.')
|
|
} catch (err) {
|
|
console.log('\nServer is not running, exiting tests.')
|
|
console.log('Start the server with `npm start` before running E2E tests.\n')
|
|
process.exit(1)
|
|
}
|
|
})
|
|
})
|