Skip to content

fix(hacker): stats 500 and resume auth; fix(test): Windows Mocha env - #981

Open
Jo-9m-n1 wants to merge 1 commit into
devfrom
fix-hacker-tests
Open

Jo-9m-n1 wants to merge 1 commit into
devfrom
fix-hacker-tests

Conversation

@Jo-9m-n1

Copy link
Copy Markdown

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:

  • Use cross-env such that DEBUG and NODE_ENV work on Windows.
  • Run tests with test, instead of development so it uses the test database.
  • Add cross-env as a devDependency.

Hacker stats:

  • Fix GET /api/hacker/status returning 500 due to an undefined age variable when incrementing age counts.
  • add reviewer stat buckets expected by tests.
  • Fix fieldOfStudy aggregation and guard missing dietaryRestrictions.

Resume upload auth:

  • Compare account IDs with String(), instead of String.toString(), so only the account linked to the hacker can upload a resume for that ID.

Test:

  • Resume upload test: log in with noTeamHackerAccount0 instead of the hacker fixture without email/passowrd.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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 DB

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Listed change(s) in the Changelog
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

- 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

This branch had an error being deployed

1 failed deployment
testing — 176e7de2 Deployed Oct 15, 2026 by Jo-9m-n1 via build (20.x) #503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant