Skip to content

Commit

Permalink
Add mocks alias
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Bolton <[email protected]>
  • Loading branch information
ibolton336 committed Mar 22, 2024
1 parent dea22e4 commit 235e8dd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/config/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const config: JestConfigWithTsJest = {
"@app/(.*)": "<rootDir>/src/app/$1",
"@assets/(.*)":
"<rootDir>../node_modules/@patternfly/react-core/dist/styles/assets/$1",
"^@mocks/(.*)$": "<rootDir>/src/mocks/$1",
},

// A list of paths to directories that Jest should use to search for files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
renderHook,
waitFor,
} from "@app/test-config/test-utils";
import { server } from "../../../../../../mocks/server";
import { rest } from "msw";
import { server } from "@mocks/server";

describe("useAssessmentStatus", () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/test-config/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@testing-library/jest-dom";
import { server } from "../../mocks/server";
import { server } from "@mocks/server";

const mockInitialized = false;

Expand Down
3 changes: 2 additions & 1 deletion client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@app/*": ["src/app/*"],
"@assets/*": [
"../node_modules/@patternfly/react-core/dist/styles/assets/*"
]
],
"@mocks/*": ["src/mocks/*"]
},
"typeRoots": ["types/", "node_modules/@types", "../node_modules/@types"],

Expand Down

0 comments on commit 235e8dd

Please sign in to comment.