Skip to content

Commit

Permalink
Testing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblurie29 committed Feb 9, 2024
1 parent 08a0a51 commit b77d89f
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:

- name: Run testing suite
run: npm run test
env:
PORT: ${{ secrets.PORT }}
HOST: ${{ secrets.HOST }}
ENVIROMENT: ${{ secrets.ENVIROMENT }}
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}

prettier-check:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .nyc_output/cadeadf8-7761-4e44-a063-1634f6be9970.json

This file was deleted.

1 change: 1 addition & 0 deletions .nyc_output/e1c1662c-f275-42f5-ac3d-7ae0882571e0.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":"e1c1662c-f275-42f5-ac3d-7ae0882571e0","pid":46957,"argv":["/usr/local/bin/node","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/node_modules/thread-stream/lib/worker.js"],"execArgv":[],"cwd":"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend","time":1707493694726,"ppid":46956,"coverageFilename":"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/.nyc_output/60651af6-f5e5-4707-bd0b-7d9ddfa70489.json","externalId":"","uuid":"60651af6-f5e5-4707-bd0b-7d9ddfa70489","files":[]}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":null,"pid":46957,"argv":["/usr/local/bin/node","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/node_modules/.bin/mocha","-r","dotenv/config","--timeout","20000","--exit","-r","ts-node/register","src/tests/Examples.tests.ts","src/tests/Passenger.tests.ts","src/tests/Trimming.tests.ts","src/tests/User.tests.ts"],"execArgv":[],"cwd":"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend","time":1707493691419,"ppid":46956,"coverageFilename":"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/.nyc_output/e1c1662c-f275-42f5-ac3d-7ae0882571e0.json","externalId":"","uuid":"e1c1662c-f275-42f5-ac3d-7ae0882571e0","files":["/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Examples.tests.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/config/server.config.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/routes/routes.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/Passenger.controller.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/data/test-data.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/data/constants.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/util/logger.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/util/trim.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/FlightRequest.controller.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/queryParameterExample.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/pathParameterExample.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/bodyParameterExample.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/retrievePassengers.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/User.controller.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Passenger.tests.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Trimming.tests.ts","/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/User.tests.ts"]}
2 changes: 1 addition & 1 deletion .nyc_output/processinfo/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"processes":{"6a421667-fa0b-4eee-96d4-95c2627ed526":{"parent":"cadeadf8-7761-4e44-a063-1634f6be9970","children":[]},"cadeadf8-7761-4e44-a063-1634f6be9970":{"parent":null,"children":["6a421667-fa0b-4eee-96d4-95c2627ed526"]}},"files":{"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Examples.tests.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/config/server.config.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/routes/routes.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/Passenger.controller.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/data/test-data.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/data/constants.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/util/logger.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/util/trim.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/FlightRequest.controller.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/queryParameterExample.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/pathParameterExample.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/bodyParameterExample.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/retrievePassengers.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/User.controller.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Passenger.tests.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Trimming.tests.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/User.tests.ts":["cadeadf8-7761-4e44-a063-1634f6be9970"]},"externalIds":{}}
{"processes":{"60651af6-f5e5-4707-bd0b-7d9ddfa70489":{"parent":"e1c1662c-f275-42f5-ac3d-7ae0882571e0","children":[]},"e1c1662c-f275-42f5-ac3d-7ae0882571e0":{"parent":null,"children":["60651af6-f5e5-4707-bd0b-7d9ddfa70489"]}},"files":{"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Examples.tests.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/config/server.config.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/routes/routes.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/Passenger.controller.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/data/test-data.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/data/constants.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/util/logger.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/util/trim.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/FlightRequest.controller.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/queryParameterExample.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/pathParameterExample.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/bodyParameterExample.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/retrievePassengers.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/User.controller.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Passenger.tests.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Trimming.tests.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/User.tests.ts":["e1c1662c-f275-42f5-ac3d-7ae0882571e0"]},"externalIds":{}}
3 changes: 0 additions & 3 deletions src/controllers/Passenger.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ import type { Request, Response } from 'express';
*/
export const getAllPassengersForUser = async (req: Request, res: Response) => {
// get the userId from the query parameters

const { id } = req.query;

if (!id) {
return res.status(400).json({ error: 'Passenger ID missing' });
}

logger.info(id);

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
Expand Down
3 changes: 0 additions & 3 deletions src/controllers/TestControllers/retrievePassengers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const retrievePassengers = async (req: Request, res: Response) => {
? record.fields['Flight Legs']
: []
) as string[][];
logger.info('Retrieved Flight Leg IDs', flightLegs);

try {
const trips = [] as Record<FieldSet>[][];
Expand All @@ -47,8 +46,6 @@ export const retrievePassengers = async (req: Request, res: Response) => {

await Promise.all(promises);

logger.info('Retrieved trips of flight legs', trips);

// Send the response or do further processing
res.status(200).send(trips);
} catch (err) {
Expand Down

0 comments on commit b77d89f

Please sign in to comment.