Skip to content

npm test failures (jest is not defined) #4785

@JC-wk

Description

@JC-wk

Describe the bug
It looks like #4591 added some jest tests which fail, these fail in my devcontainer, I think they need to be converted to use vitest

Steps to reproduce

  1. npm test
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 2 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/App.test.tsx [ src/App.test.tsx ]
ReferenceError: it is not defined
 ❯ src/App.test.tsx:5:1
      3| import { App } from "./App";
      4| 
      5| it('renders "Welcome to Your Fluent UI App"', () => {
       | ^
      6|   render(<App />);
      7|   const linkElement = screen.getByText(/Welcome to Your Fluent UI App/i);

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯

 FAIL  src/hooks/useComponentManager.test.tsx [ src/hooks/useComponentManager.test.tsx ]
ReferenceError: jest is not defined
 ❯ src/hooks/useComponentManager.test.tsx:8:1
      6| 
      7| // Mock dependencies
      8| jest.mock("./useAuthApiCall", () => ({
       | ^
      9|   useAuthApiCall: () => jest.fn(),
     10|   HttpMethod: { Get: "GET" },

Azure TRE release version (e.g. v0.14.0 or main):
main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions