Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Slider component #190

Merged
merged 8 commits into from
Jun 22, 2022
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
16 changes: 16 additions & 0 deletions config/jest/identity-obj-proxy-revised.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Proxy for jest tests to convert css moodule class names.
// Based on https://medium.com/trabe/testing-css-modules-in-react-components-with-jest-enzyme-and-a-custom-modulenamemapper-8ff86c7d18a2

module.exports = new Proxy(
{},
{
get: function getter(target, key) {
if (key === '__esModule') {
return false;
}

// Convert camelCase to kebab-case for class selectors in unit tests.
return key.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);
},
}
);
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"html-webpack-plugin": "5.5.0",
"husky": "7.0.4",
"icomoon-react": "^3.0.0",
"identity-obj-proxy": "3.0.0",
"install-peers": "1.0.3",
"install-peers-cli": "2.2.0",
"jest": "27.4.3",
Expand Down Expand Up @@ -209,7 +208,7 @@
"modulePaths": [],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
"^.+\\.module\\.(css|sass|scss)$": "<rootDir>/config/jest/identity-obj-proxy-revised.js"
},
"moduleFileExtensions": [
"web.js",
Expand Down
Loading