Tests passing locally but failing with circleci Typescript issue

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

A very similar question has been reposted to Stack Overflow:

well after I didn’t get any help there, thought that I would try the website of the place that is giving me troubles

Of course, but it is still good to declare your cross-posting. If you do not then readers will assume that the copy they are looking at is the only one. On that basis, they may go to substantial lengths to answer the question, only to later find that you received duplicate help elsewhere.

In those circumstances, the helpful person may feel their time would have been better spent elsewhere. This is especially the case where a person seeking help abandons the forum and does not ever see (or reply to) the kind volunteer help they have received.

(I have left some things for you to check on the other post).

Ok thank you @halfer , I’ll keep that in mind