chairemobilite / transition

Transition is a modern new approach to transit planning. It's a web application to model, simulate and plan public transit and alternative transportation.
http://transition.city
MIT License
20 stars 13 forks source link

tests: support typescript syntax in tests. #1006

Open tahini opened 4 days ago

tahini commented 4 days ago

Jest does not support typescript syntax. All modules imported by jest need to be in javascript (I'm not sure exactly which version). We can simply stub the packages imported with this syntax. But we could also make sure our jest configuration supports it.

To test this, search in the code for example for jest.mock('react-markdown', () => 'Markdown'); and remove this line. The error will happen and we can see the various suggestions to fix it.