Has anyone figured out how to run SST Jest tests i...
# help
k
Has anyone figured out how to run SST Jest tests in WebStorm? Just to be sure, I created a brand new SST app, and went to run the test in WebStorm. However the
jest
package and Jest config haven't been autodetected.
s
this is my intelijj idea config
f
Thanks @Slawomir Stec for the screenshot. I will add a doc on this following your screenshot.
@kierans777 yeah, Dax is working on something that should fix this.
@thdxr just to double check, the jest config change we are working on should let WebStorm to automatically pick up the SST’s default eslint config right?
t
Yep that's right
k
@thdxr What's the rough ETA on this fix?
t
It'll be out next week, I got everything working on Friday but need to update some docs and print some warnings for people with the old setup
k
Thanks @Slawomir Stec. What does your Jest config file look like? I tend not to use Jest so I'm not as familiar with it
s
I have Typescript front and backend, I think this is a standard config (my integ tests are under src/tests/integ)
Copy code
module.exports = {
  clearMocks: false,
  testEnvironment: 'node',
  testMatch: [
    '**/src/tests/integ/**/*.test.ts'
  ],
  transform: {
    '^.+\\.(ts|tsx)$': 'ts-jest'
  },
  globals: {
    'ts-jest': {
      tsconfig: 'tsconfig.json',
      isolatedModules: true
    }
  },
  moduleDirectories: ['node_modules', 'src']
}
and following dependencies:
Copy code
"@types/jest": "^27.0.1",
"jest": "^27.1.0",
"jest-runner-tsc": "^1.6.0",
"ts-jest": "^27.0.5"
k
Thanks @Slawomir Stec I'll give that shot soon