-
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.
make endpoint to get accompanying passengers
- Loading branch information
1 parent
20d4c88
commit 7628686
Showing
10 changed files
with
104 additions
and
9 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
.nyc_output/processinfo/26ebb75a-bcc7-4f51-86e7-1546eecf58e3.json
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 @@ | ||
{"parent":null,"pid":14891,"argv":["/opt/homebrew/Cellar/node/20.6.1/bin/node","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/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/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend","time":1707261398684,"ppid":14890,"coverageFilename":"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/.nyc_output/26ebb75a-bcc7-4f51-86e7-1546eecf58e3.json","externalId":"","uuid":"26ebb75a-bcc7-4f51-86e7-1546eecf58e3","files":["/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Examples.tests.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/config/server.config.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/routes/routes.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/Passenger.controller.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/data/test-data.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/data/constants.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/util/logger.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/util/trim.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/FlightRequest.controller.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/queryParameterExample.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/pathParameterExample.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/bodyParameterExample.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/retrievePassengers.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/User.controller.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Passenger.tests.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Trimming.tests.ts","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/User.tests.ts"]} |
1 change: 0 additions & 1 deletion
1
.nyc_output/processinfo/6ef9d3c5-9edd-4152-a8c1-360cb9258935.json
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
.nyc_output/processinfo/cef9e676-5d26-489f-a7fe-42f784933324.json
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 @@ | ||
{"parent":"26ebb75a-bcc7-4f51-86e7-1546eecf58e3","pid":14891,"argv":["/opt/homebrew/Cellar/node/20.6.1/bin/node","/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/node_modules/thread-stream/lib/worker.js"],"execArgv":[],"cwd":"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend","time":1707261400818,"ppid":14890,"coverageFilename":"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/.nyc_output/cef9e676-5d26-489f-a7fe-42f784933324.json","externalId":"","uuid":"cef9e676-5d26-489f-a7fe-42f784933324","files":[]} |
1 change: 0 additions & 1 deletion
1
.nyc_output/processinfo/d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e.json
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
{"processes":{"6ef9d3c5-9edd-4152-a8c1-360cb9258935":{"parent":"d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e","children":[]},"d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e":{"parent":null,"children":["6ef9d3c5-9edd-4152-a8c1-360cb9258935"]}},"files":{"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Examples.tests.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/config/server.config.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/routes/routes.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/Passenger.controller.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/data/test-data.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/data/constants.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/FlightRequest.controller.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/queryParameterExample.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/pathParameterExample.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/bodyParameterExample.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/TestControllers/retrievePassengers.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/util/logger.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/controllers/User.controller.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/Trimming.tests.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/util/trim.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"],"/Users/jacoblurie/Git/College/ChangePlusPlus/miracleflightsbackend/src/tests/User.tests.ts":["d17279ea-2c6c-4bc8-bf91-e1388e3c7c6e"]},"externalIds":{}} | ||
{"processes":{"26ebb75a-bcc7-4f51-86e7-1546eecf58e3":{"parent":null,"children":["cef9e676-5d26-489f-a7fe-42f784933324"]},"cef9e676-5d26-489f-a7fe-42f784933324":{"parent":"26ebb75a-bcc7-4f51-86e7-1546eecf58e3","children":[]}},"files":{"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Examples.tests.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/config/server.config.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/routes/routes.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/Passenger.controller.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/data/test-data.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/data/constants.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/util/logger.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/util/trim.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/FlightRequest.controller.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/queryParameterExample.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/pathParameterExample.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/bodyParameterExample.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/TestControllers/retrievePassengers.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/controllers/User.controller.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Passenger.tests.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/Trimming.tests.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"],"/Users/sophiascomputer/Documents/vanderbilt/changeplusplus/MFbackend/miracleflightsbackend/src/tests/User.tests.ts":["26ebb75a-bcc7-4f51-86e7-1546eecf58e3"]},"externalIds":{}} |
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,54 @@ | ||
import { configureServer } from '../config/server.config'; | ||
import chaiHttp from 'chai-http'; | ||
import dotenv from 'dotenv'; | ||
import chai, { expect } from 'chai'; | ||
import type { Server } from 'http'; | ||
dotenv.config(); | ||
|
||
// set up chai | ||
chai.use(chaiHttp); | ||
chai.should(); | ||
|
||
// set up mock server | ||
const app = configureServer(); | ||
let server: Server; | ||
|
||
// start mock server | ||
before(done => { | ||
server = app.listen(3483, () => { | ||
done(); | ||
}); | ||
}); | ||
|
||
// close mock server | ||
after(done => { | ||
server.close(); | ||
done(); | ||
}); | ||
|
||
// describe is group of tests | ||
// it is the actual test itself | ||
// Test case | ||
describe('GET /passenger', () => { | ||
it('should return a 400 response', done => { | ||
chai | ||
.request(app) | ||
.get('/passenger') | ||
.query({ id: '' }) | ||
.end((err, res) => { | ||
expect(res).to.have.status(400); | ||
done(); | ||
}); | ||
}); | ||
it('should be an accompanying passenger', done => { | ||
chai | ||
.request(app) | ||
.get('/passenger') | ||
.query({ id: 'recleNlsBm3dheZHy' }) | ||
.end((err, res) => { | ||
expect(res.body[0]['First Name']).to.equal('Bail'); | ||
expect(res).to.have.status(200); | ||
done(); | ||
}); | ||
}); | ||
}); |