Fix jest tests
Test / test (push) Successful in 33s
Details
Test / test (push) Successful in 33s
Details
This commit is contained in:
parent
e438b5cb5b
commit
b85be9cefe
|
|
@ -2,8 +2,9 @@ import { act, render, screen, waitFor } from "@testing-library/react"
|
||||||
import MatchMediaMock from "jest-matchmedia-mock"
|
import MatchMediaMock from "jest-matchmedia-mock"
|
||||||
|
|
||||||
import { createRemixStub, RemixStubProps } from "@remix-run/testing"
|
import { createRemixStub, RemixStubProps } from "@remix-run/testing"
|
||||||
import App from "./root"
|
import App from "../root"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
|
import Index from "./_index"
|
||||||
let RemixStub: (props: RemixStubProps) => React.JSX.Element
|
let RemixStub: (props: RemixStubProps) => React.JSX.Element
|
||||||
|
|
||||||
describe("root", () => {
|
describe("root", () => {
|
||||||
|
|
@ -13,8 +14,8 @@ describe("root", () => {
|
||||||
path: "/",
|
path: "/",
|
||||||
meta: () => [],
|
meta: () => [],
|
||||||
links: () => [],
|
links: () => [],
|
||||||
loader: () => ({ isSupported: true }),
|
loader: () => ({ isSupported: true, isMobileSafari: true }),
|
||||||
Component: App,
|
Component: Index,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
@ -35,9 +36,12 @@ describe("root", () => {
|
||||||
test("they are instructed to install tack up now", async () => {
|
test("they are instructed to install tack up now", async () => {
|
||||||
render(<RemixStub />)
|
render(<RemixStub />)
|
||||||
|
|
||||||
await waitFor(() => screen.findByText<HTMLElement>(/Install/), {
|
await waitFor(
|
||||||
timeout: 2000,
|
() => screen.findByText<HTMLElement>(/Install Tack Up Now!/),
|
||||||
})
|
{
|
||||||
|
timeout: 2000,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
expect(true).toBe(true)
|
expect(true).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
@ -5,14 +5,15 @@ const ignorePatterns = [
|
||||||
"\\/\\.tmp\\/",
|
"\\/\\.tmp\\/",
|
||||||
"\\/\\.cache\\/",
|
"\\/\\.cache\\/",
|
||||||
"data",
|
"data",
|
||||||
"e2e"
|
"e2e",
|
||||||
];
|
]
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
"^@web3-storage/multipart-parser$": require.resolve(
|
"^@web3-storage/multipart-parser$": require.resolve(
|
||||||
"@web3-storage/multipart-parser"
|
"@web3-storage/multipart-parser"
|
||||||
),
|
),
|
||||||
|
"\\?url$": "<rootDir>/url-mock.js",
|
||||||
},
|
},
|
||||||
modulePathIgnorePatterns: ignorePatterns,
|
modulePathIgnorePatterns: ignorePatterns,
|
||||||
transform: {
|
transform: {
|
||||||
|
|
@ -28,4 +29,4 @@ module.exports = {
|
||||||
setupFiles: [],
|
setupFiles: [],
|
||||||
testEnvironment: "jsdom",
|
testEnvironment: "jsdom",
|
||||||
setupFilesAfterEnv: ["./setupTests.ts", "@testing-library/jest-dom"],
|
setupFilesAfterEnv: ["./setupTests.ts", "@testing-library/jest-dom"],
|
||||||
};
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export default "/path/to/something"
|
||||||
Loading…
Reference in New Issue