-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bde51d
commit 02e7ed8
Showing
15 changed files
with
2,487 additions
and
1,931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Config } from "jest"; | ||
|
||
const config: Config = { | ||
projects: [ | ||
"<rootDir>/packages/*" | ||
], | ||
testRegex: "/tests/*/.*\\.test\\.(ts|tsx)$", | ||
testPathIgnorePatterns: ["/node_modules/", "/dist/"], | ||
cacheDirectory: "./node_modules/.cache/jest", | ||
clearMocks: true, | ||
verbose: true | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Config } from "jest"; | ||
import { pathsToModuleNameMapper } from "ts-jest"; | ||
import { swcConfig } from "./swc.jest.ts"; | ||
import { compilerOptions } from "./tsconfig.json"; | ||
|
||
const config: Config = { | ||
testEnvironment: "jsdom", | ||
transform: { | ||
"^.+\\.(js|ts|tsx)$": ["@swc/jest", swcConfig as Record<string, unknown>] | ||
}, | ||
moduleNameMapper: { | ||
"\\.css$": "identity-obj-proxy", // https://jestjs.io/docs/webpack#mocking-css-modules | ||
...pathsToModuleNameMapper(compilerOptions.paths, { | ||
prefix: "<rootDir>" | ||
}) | ||
} | ||
// setupFilesAfterEnv: [ | ||
// "@testing-library/jest-dom/extend-expect" | ||
// ] | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineJestConfig } from "@workleap/swc-configs"; | ||
|
||
export const swcConfig = defineJestConfig({ | ||
react: true | ||
}); | ||
|
14 changes: 14 additions & 0 deletions
14
packages/styled-system/tests/jest/useColorSchemeValue.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { renderHookWithTheme } from "@hopper-ui/test-utils"; | ||
import { useColorSchemeValue } from "../../src/index.ts"; | ||
|
||
test("return the light color value when the color scheme is light", async () => { | ||
const { result } = renderHookWithTheme(() => useColorSchemeValue("light-color", "dark-color"), undefined, { colorScheme: "light" }); | ||
|
||
expect(result.current).toBe("light-color"); | ||
}); | ||
|
||
test("return the dark color value when the color scheme is dark", async () => { | ||
const { result } = renderHookWithTheme(() => useColorSchemeValue("light-color", "dark-color"), undefined, { colorScheme: "dark" }); | ||
|
||
expect(result.current).toBe("dark-color"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"extends": "@workleap/typescript-configs/library.json", | ||
"exclude": ["node_modules"] | ||
"exclude": ["node_modules"], | ||
"include": ["**/*", "../../types/*"], | ||
} |
Oops, something went wrong.