feat(e2e): separating e2e from unit tests

This commit is contained in:
Chris Troutner
2025-05-23 07:26:51 -07:00
parent 3a4569c33f
commit 3f91653d23
4 changed files with 39 additions and 5 deletions
@@ -0,0 +1,32 @@
/*
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)
}
})
})
+5 -3
View File
@@ -13,7 +13,7 @@ import axios from 'axios'
// Local support libraries
import config from '../../../config/index.js'
import Server from '../../../bin/server.js'
// import Server from '../../../bin/server.js'
import testUtils from '../../utils/test-utils.js'
import AdminLib from '../../../src/adapters/admin.js'
const adminLib = new AdminLib()
@@ -26,10 +26,12 @@ const LOCALHOST = `http://localhost:${config.port}`
if (!config.noMongo) {
describe('Auth', () => {
before(async () => {
const app = new Server()
// const app = new Server()
// This should be the first instruction. It starts the REST API server.
await app.startServer()
// await app.startServer()
// TODO:
// Stop the IPFS node for the rest of the e2e tests.
// await app.controllers.adapters.ipfs.stop()