Skip to content

parse does not find name for test.each block #29

Closed
@firsttris

Description

@firsttris
      test.each([
        [1, 1, 2],
        [1, 2, 3],
        [2, 1, 3]
      ])('wtf', (a, b, expected) => {
        expect(a + b).toBe(expected);
      });

https://jestjs.io/docs/en/api#testeachtablename-fn-timeout
(note: its not possible to put a test.each inside a "it" or a "test" )

parser outputs a warning if he detects such a block.

  console.warn node_modules/jest-editor-support/build/parsers/typescript_parser.js:96
    **NamedBlock but no name found for it tsNode= NodeObject** {
      pos: 442,
      end: 526,
      flags: 0,
      modifierFlagsCache: 0,
      transformFlags: 0,
      parent: undefined,
      kind: 195,
      expression: NodeObject {
        pos: 442,
        end: 459,
        flags: 0,
        modifierFlagsCache: 0,
        transformFlags: 0,
        parent: undefined,
        kind: 193,
        expression: IdentifierObject {
          pos: 442,
          end: 454,
          flags: 0,
          modifierFlagsCache: 0,
          transformFlags: 0,
          parent: undefined,
          kind: 75,
          escapedText: 'test'
        },
        questionDotToken: undefined,
        name: IdentifierObject {
          pos: 455,
          end: 459,
          flags: 0,
          modifierFlagsCache: 0,
          transformFlags: 0,
          parent: undefined,
          kind: 75,
          escapedText: 'each'
        }
      },
      questionDotToken: undefined,
      arguments: [
        NodeObject {
          pos: 460,
          end: 525,
          flags: 0,
          modifierFlagsCache: 0,
          transformFlags: 0,
          parent: undefined,
          kind: 191,
          multiLine: true,
          elements: [Array]
        },
        pos: 460,
        end: 525
      ]
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions