jest-dynamodb icon indicating copy to clipboard operation
jest-dynamodb copied to clipboard

Test errors out at first use of typescript syntax

Open BoilerTom90 opened this issue 1 year ago • 0 comments

I'm trying to use jest-dynamodb, and my jest scripts are written in typescript. Prior to trying this package, I was testing against a real dynamodb table on AWS and the scripts worked. I've switched to this package and the instructions say to change the preset from ts-jest to @shelf/jest-dynamodb. I've done that:

import type { Config } from '@jest/types';
import { baseJestConfig } from '../../jest.config.base';
const config: Config.InitialOptions = {
   ...baseJestConfig,
   preset: '@shelf/jest-dynamodb',  // 'ts-jest',
   projects: ['./'],
   moduleNameMapper: {
      '^uuid$': require.resolve('uuid')
   },
   setupFilesAfterEnv: ['./tests/common-mocks.js']
};
export default config;

But, when I try to run the test, at the first encounter of typescript syntax, the test errors out.

const x: number = 1;

describe('Env Test', () => {
   test('Environment works', () => {
      expect(true).toBe(true);
   })
});

image

Does this package support tests written in typescript?

BoilerTom90 avatar Apr 22 '23 19:04 BoilerTom90