0

I am getting SyntaxError: /test/ut/client/breadcrumbs/BreadCrumbs.ut.test.js: Unexpected token (12:6) error. Code is given below. And the code coverage is 0% because test suits failed.

I am using jest v-"^24.8.0", jest-dom v-"^3.5.0", jest-junit v-"^6.4.0"

describe("BreadCrumbs", () => {
  afterEach(cleanup);
  test("Should render breadcrumbs on usecase page", () => {
    const useCaseBreadCrumbs = create(
      <BreadCrumbs
        list={USECASE_BREADCRUMBS.list}
        disabledLabel={USECASE_BREADCRUMBS.disabledLink}
      />
    );
    console.log(useCaseBreadCrumbs);
    expect(tree).toMatchSnapshot();
  });
});

Screenshot is given below

2
  • 1
    Did you import react at the top of the page to use jsx? ;) Commented Jun 26, 2019 at 7:18
  • Also a heads up, expect(tree)..., tree has not been defined, this should be useCaseBreadCrumbs Commented Jun 26, 2019 at 7:46

1 Answer 1

1

You need to add import React from "react"; on top

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.