Skip to content

Conversation

@chadoh
Copy link
Collaborator

@chadoh chadoh commented Jun 28, 2019

The goal: add typescript and jest, so we can have the safety of both a type-checker and our own automated tests.

To do

  • get typescript compilation working
  • get tests written in typescript passing
  • configure eslint to complain about typescript errors

@chadoh
Copy link
Collaborator Author

chadoh commented Jun 28, 2019

I wasn't originally going to add Typescript, but I was having trouble getting Jest to understand import and export statements. I had another project with Jest configured with the ts-jest transformer, so I decided to try that, since having Typescript around is also a big help.

Unfortunately, I still ran into troubles, as shown by the TODO statement added in the second commit here.

I'll try to circle back to this soon.

@chadoh chadoh mentioned this pull request Jun 28, 2019
@chadoh chadoh force-pushed the typescript-jest branch from da12c7e to 32c14de Compare July 18, 2019 14:00
The setup here closely follows the instructions at
https://jestjs.io/docs/en/getting-started

One of the trickiest things to note is the `api.env('test')` check in
`.babelrc.js` – we need this to be `false` for our build script, but
`commonjs` for testing. This is what necessitated changing `.babelrc` to
a full js file.
@chadoh chadoh force-pushed the typescript-jest branch from 32c14de to 7b75e85 Compare July 18, 2019 14:51
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.

2 participants