serverless-typescript-starter icon indicating copy to clipboard operation
serverless-typescript-starter copied to clipboard

Debugging in vscode with Jest Runner

Open groffcole opened this issue 4 years ago • 1 comments

I'm trying to debug this template using vscode and the vscode-jest-runner extension. I can run the initial test successfully but when I try to debug the test I receive the following error:

SyntaxError: /.../tests/handler.test.ts: Unexpected token, expected ";" (5:38)

      3 | 
      4 | test("hello", async () => {
    > 5 |   const event = { body: "Test Body" } as APIGatewayEvent;

To summarize:

  • using vscode-jest-runner: https://github.com/firsttris/vscode-jest-runnerhttps://github.com/firsttris/vscode-jest-runner
  • tests run perfectly when running the serverless-bundle test command
  • debugging in vscode using the extension mentioned above does_not work

Any idea why this might be happening or how I can resolve it? It seems like the run and debug are using different jests or something like that.

Thanks.

groffcole avatar Jan 11 '21 13:01 groffcole

I'm realizing that this might be a re-issue of something I brought up a while ago: https://github.com/AnomalyInnovations/serverless-bundle/issues/70. I can delete this issue if things are still in limbo.

groffcole avatar Jan 14 '21 13:01 groffcole