mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
V2 e2e playwright (#343)
* test: create utility for uploading test-db * chore: upgrade deps * refactor: remove unused functions * chore: create testing boilerplate * test: upload showfile
This commit is contained in:
@@ -213,13 +213,13 @@ export const shutdown = async (exitCode = 0) => {
|
||||
|
||||
process.on('exit', (code) => console.log(`Ontime exited with code: ${code}`));
|
||||
|
||||
process.on('unhandledRejection', async () => {
|
||||
logger.error('SERVER', 'Error: unhandled rejection');
|
||||
process.on('unhandledRejection', async (error) => {
|
||||
logger.error('SERVER', `Error: unhandled rejection ${error}`);
|
||||
await shutdown(1);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', async () => {
|
||||
logger.error('SERVER', 'Error: uncaught exception');
|
||||
process.on('uncaughtException', async (error) => {
|
||||
logger.error('SERVER', `Error: uncaught exception ${error}`);
|
||||
await shutdown(1);
|
||||
});
|
||||
|
||||
|
||||
@@ -288,13 +288,3 @@ export const dbUpload = async (req, res) => {
|
||||
const file = req.file.path;
|
||||
await uploadAndParse(file, req, res, options);
|
||||
};
|
||||
|
||||
// Create controller for POST request to '/ontime/dbpath'
|
||||
// Returns -
|
||||
export const dbPathToUpload = async (req, res) => {
|
||||
if (!req.body.path) {
|
||||
res.status(400).send({ message: 'Path to file not found' });
|
||||
return;
|
||||
}
|
||||
await uploadAndParse(req.body.path, req, res);
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@ import express from 'express';
|
||||
import { uploadFile } from '../utils/upload.js';
|
||||
import {
|
||||
dbDownload,
|
||||
dbPathToUpload,
|
||||
dbUpload,
|
||||
getAliases,
|
||||
getInfo,
|
||||
@@ -19,11 +18,11 @@ import {
|
||||
} from '../controllers/ontimeController.js';
|
||||
|
||||
import {
|
||||
viewValidator,
|
||||
validateAliases,
|
||||
validateUserFields,
|
||||
validateSettings,
|
||||
validateOSC,
|
||||
validateSettings,
|
||||
validateUserFields,
|
||||
viewValidator,
|
||||
} from '../controllers/ontimeController.validate.js';
|
||||
|
||||
export const router = express.Router();
|
||||
@@ -69,6 +68,3 @@ router.get('/osc', getOSC);
|
||||
|
||||
// create route between controller and '/ontime/osc' endpoint
|
||||
router.post('/osc', validateOSC, postOSC);
|
||||
|
||||
// create route between controller and '/ontime/dbpath' endpoint
|
||||
router.post('/dbpath', dbPathToUpload);
|
||||
|
||||
Reference in New Issue
Block a user