Repository navigation
Conversation
- fix getStats age bug, reviewer buckets, cache and field aggregations - fix ensureAccountLinkedToHacker account ID comparison for resume routes - run tests with cross-env and NODE_ENV=test on npm test / test-windows - use account credentials in resume upload integration test
janekhuong
left a comment
There was a problem hiding this comment.
thanks for fixing the tests. a few notes:
- update the package-lock.json file with cross-env
- can we drop all the "-windows" scripts and use cross env for all of them?
- add a "--timeout 10000" flag to test script; there are a couple tests timing out bc they take longer than 2 seconds
so the script section would now look like:
"scripts": {
"start": "cross-env DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js",
"deploy": "NODE_ENV=deployment node ./bin/www.js",
"debug": "cross-env DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js",
"test": "cross-env DEBUG=hackboard:* NODE_ENV=test mocha -r dotenv/config --reporter spec "tests/.js" --exit --timeout 10000",
"seed": "cross-env NODE_ENV=development node ./seed/index.js",
"docs": "apidoc -i ./routes -o ./docs/api/",
"format": "prettier --write "/.js"",
"lint": "eslint --fix "**/.js""
}
| const stats = { | ||
| total: 0, | ||
| status: {}, | ||
| reviewerStatus: {}, |
There was a problem hiding this comment.
Humor an old alum who saw this in GitHub notifications... I know this isn't what's in the model but seeing this in the diff is triggering me. Shouldn't this be modeled as an object?
reviews: [
{
reviewerId: "...", // Reference to the reviewer's account
status: "Accept",
comments: "Good experience and a thoughtful application."
}
]
Summary:
Fixes failing Mocha integration tests and related API bugs in hacker stats and resume upload authorization.
List of changes:
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Test:
cross-envsuch thatDEBUGandNODE_ENVwork on Windows.test, instead ofdevelopmentso it uses the test database.cross-envas adevDependency.Hacker stats:
GET /api/hacker/statusreturning500due to an undefinedagevariable when incrementing age counts.fieldOfStudyaggregation and guard missingdietaryRestrictions.Resume upload auth:
String(), instead ofString.toString(), so only the account linked to the hacker can upload a resume for that ID.Test:
noTeamHackerAccount0instead of the hacker fixture without email/passowrd.Type of change
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
npm run test-windows: 171 (all) passing (took around 20 mins) on local Mongo test DBChecklist: