Skip to content

Parsing fails upon encountering optional chaining #51

@JonathanWilbur

Description

@JonathanWilbur

Upon encountering an optional chaining operator, the parsing fails. I am using this in the Jest VS Code Extension, but I have also tried the other popular Jest VS Code Extension, both of which fail and both of which use this library. Here is an example that you can try yourself:

This parses correctly. In VS Code, I can see the "Run | Debug" floating over the tests.

describe("Normalization", () => {
    test("adds a module to every assignment", () => {
        expect(assignment.module.name).toBe("AuthenticationFramework");
    });
});

When you add the question mark (optional chaining operator), it no longer parses correctly.

This does not parse correctly. I cannot see the "Run | Debug" floating over the tests anymore.

describe("Normalization", () => {
    test("adds a module to every assignment", () => {
        expect(assignment.module?.name).toBe("AuthenticationFramework");
    });
});

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