Hi guys, I have tests that are all passing locally, but when circleci runs the same tests they are failing.
error:
FAIL server/src/User-Server/test/routes.test.ts
● Test suite failed to run
SyntaxError: /home/circleci/project/server/src/userServer/test/routes.test.ts: Unexpected token, expected "," (7:10)
5 | //close server after each request
6 | afterEach(
> 7 | async (): Promise<void> => {
| ^
8 | await server.close();
9 | },
10 | );
this error is at any point there is TS definition.
config.yml
jobs:
build:
docker:
- image: circleci/node:10.15.3
# working_directory: ~/repo
steps:
- checkout
#download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: npm install
- run: npm test
jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
};
.babelrc
{
"presets": ["@babel/preset-typescript"]
}
Thanks for any and all help