arnoldclark / front-end-interview

MIT License
2 stars 2 forks source link

Adds TypeScript support #5

Closed johnmccollum closed 2 years ago

johnmccollum commented 2 years ago

This PR adds TS support so that candidates can choose the language that best suits them. It will also allow us to use this repo as an internal training tool to upskill devs on TS!

johnmccollum commented 2 years ago

Adding the do not merge label for now until #4 has been merged. (As we rely on Webpack config in this branch)

johnmccollum commented 2 years ago

But given it's such a small change, I'll look into it.

Took a little more effort than I thought 🙈

Added a script that

futuresocks commented 2 years ago

Had a play about with things and I can happily vouch for the following:

Sadly as things stand, the tests don't run if you use a type in the src files. This would be enough to block the whole endeavour for me, as ideally we'd like to see candidates testing. Unless there's some Jest config shenanigans we can pull out the bag, @johnmccollum?

johnmccollum commented 2 years ago

I think I need to spend a bit more time looking at the testing side. Thanks for giving it a test drive @futuresocks and @jordandavidson1990!

futuresocks commented 2 years ago

In lieu of me having write-access to this repo, @johnmccollum 👀

The test issue should be fixable by installing @babel/preset-typescript and adding it to babel.config.json

{
  "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"]
}

I've tried this locally and it means I can use custom types and interfaces from the types folder in files without Jest getting upset.

johnmccollum commented 2 years ago

Sorry about that, @futuresocks. You should have push access now, would you like to try again?

futuresocks commented 2 years ago

Sorry about that, @futuresocks. You should have push access now, would you like to try again?

9BrpVghSQNX7

futuresocks commented 2 years ago

Not sure I can approve this now I'm involved up to my neck. But if you're reading this I reckon it works great