From 5adb73127a9dcf6610f22403fb36a9d71cf0c9a7 Mon Sep 17 00:00:00 2001 From: cristinabuenahora Date: Mon, 30 Oct 2023 18:37:18 -0400 Subject: [PATCH] fix tests --- plugins/tech-radar/jest.config.js | 6 +++--- plugins/tech-radar/src/components/App.test.tsx | 3 +-- plugins/tech-radar/tsconfig.json | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/tech-radar/jest.config.js b/plugins/tech-radar/jest.config.js index e7fb0cf..edca675 100644 --- a/plugins/tech-radar/jest.config.js +++ b/plugins/tech-radar/jest.config.js @@ -2,13 +2,13 @@ module.exports = { moduleNameMapper: { // map static asset imports to a stub file under the assumption they are not important to our tests "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": - "/__mocks__/fileMock.js", + "/__mocks__/fileMock.js", // map style asset imports to a stub file under the assumption they are not important to our tests "\\.(css|less)$": "/__mocks__/styleMock.js", "@cortexapps/plugin-core/components": - "/node_modules/@cortexapps/plugin-core/dist/components.cjs.js", + "/../../node_modules/@cortexapps/plugin-core/dist/components.cjs.js", "@cortexapps/plugin-core": - "/node_modules/@cortexapps/plugin-core/dist/index.cjs.js", + "/../../node_modules/@cortexapps/plugin-core/dist/index.cjs.js", }, setupFilesAfterEnv: ["/setupTests.ts"], testEnvironment: "jsdom", diff --git a/plugins/tech-radar/src/components/App.test.tsx b/plugins/tech-radar/src/components/App.test.tsx index 7a807a4..766df1b 100644 --- a/plugins/tech-radar/src/components/App.test.tsx +++ b/plugins/tech-radar/src/components/App.test.tsx @@ -1,11 +1,10 @@ import { render, screen } from "@testing-library/react"; import App from "./App"; -import "@types/jest"; describe("App", () => { it("indicates that it's an awesome plugin", () => { render(); - expect(screen.queryByText(/My Awesome Cortex Plugin/)).toBeInTheDocument(); + expect(screen.queryByText(/Tech Radar/)).toBeInTheDocument(); }); }); diff --git a/plugins/tech-radar/tsconfig.json b/plugins/tech-radar/tsconfig.json index da7c975..2ebb4a8 100644 --- a/plugins/tech-radar/tsconfig.json +++ b/plugins/tech-radar/tsconfig.json @@ -11,6 +11,6 @@ "removeComments": true, "strictNullChecks": true, "target": "es6", - "typeRoots": ["./node_modules/@types"] + "typeRoots": ["../../node_modules/@types", "./node_modules/@types"] } }