Add election api typescript - #166
Open
kodikos wants to merge 17 commits into
Open
Conversation
This commit creates the skeleton application of election-api-javascript in a TypeScript environment.
… files Added Jest configuration for TypeScript support and copied JSON test files from election-api-javascript.
Co-authored-by: Allan Mckinlay <122284042+amckinlaybbc@users.noreply.github.com>
Co-authored-by: Paul Douglas Brimicombe <paul.brimicombe@bbc.co.uk>
Co-authored-by: Paul Douglas Brimicombe <paul.brimicombe@bbc.co.uk>
Co-authored-by: Paul Douglas Brimicombe <paul.brimicombe@bbc.co.uk>
…the store As per comment, I'm returning null to rely on a message that indicates the new data has been created successfully.
Result | null was incompatible with the result type of the function.
Co-authored-by: Paul Douglas Brimicombe <paul.brimicombe@bbc.co.uk>
iuketaylor
reviewed
Aug 11, 2026
There was a problem hiding this comment.
copied from slack convo
The TS code looks good, as an MVP could probably get away with just updating the TS/node/dependency versions and verifying the tests still work
Everything i'd probably change to modernise it:
- Node 18 EOL - move to LTS
- TS 5.1.3 - move to 7.0.2 (probably restricting candidates if we stay on 5)
- Express/other deps need updating
- Replace jest with vitest (nightmare to work with TS)
- replace ts-node/ts-node-dev with tsx
- convert from commonJS to ESM
- Update readme instructions to install latest stuff
- Update any links referencing old js files
Co-authored-by: Luke Taylor <37551503+iuketaylor@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This is restoring the typescript port of the election api test that Rossano did. With some tweaks to freshen it.
Why?
We're appearing a bit dated when we give users pure JS tests. In some cases, we specifically want to assess their typescript abilities, and this hasn't been possible with these standard tests.