Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
*/

module.exports = {
globals: {
window: true,
DEPRECATED_ADAPTER_COMPONENT: false,
ENABLE_INNER_HTML: true,
ENABLE_ADJACENT_HTML: true,
ENABLE_SIZE_APIS: true,
ENABLE_TEMPLATE_CONTENT: true,
ENABLE_CLONE_NODE: true,
ENABLE_CONTAINS: true,
ENABLE_MUTATION_OBSERVER: true,
},
clearMocks: true,
coverageDirectory: "coverage",
moduleNameMapper: {
"@tarojs/components": "@tarojs/components/dist-h5/react",
"@tarojs/components": "@tarojs/components/lib/react",
},
setupFilesAfterEnv: ["<rootDir>/jest/jest-setup.ts"],
testEnvironment: "jest-environment-jsdom",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/navbar/__tests__/navbar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render } from "@testing-library/react"
import * as React from "react"
import { prefixClassname } from "../../styles"
import { HAIRLINE_BOTTOM } from "../../styles/hairline"
import { HAIRLINE_BORDER_BOTTOM } from "../../styles/hairline"
import Navbar from "../navbar"

describe("<Navbar />", () => {
Expand All @@ -15,6 +15,6 @@ describe("<Navbar />", () => {
it("should have hairline--bottom of classNames", () => {
const { container } = render(<Navbar bordered />)
const el = container.querySelector(`.${prefixClassname("navbar")}`)
expect(el).toHaveClass(HAIRLINE_BOTTOM)
expect(el).toHaveClass(HAIRLINE_BORDER_BOTTOM)
})
})