From dece718d851aeeaf503c38df0c58b25a67f9d811 Mon Sep 17 00:00:00 2001 From: witt Date: Thu, 24 Jun 2021 00:15:58 +0800 Subject: [PATCH] fix(bundle): fix modules missing in yarn berry (#563) * chore: add peer dependencies * fix(bundle): fix modules missing in yarn berry * chore: upgrade configs for jest 27 --- .jest.config.js | 2 ++ components/avatar/__tests__/index.test.tsx | 2 +- package.json | 28 ++++++++++++---------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.jest.config.js b/.jest.config.js index b554fbddb..0e305ce44 100644 --- a/.jest.config.js +++ b/.jest.config.js @@ -1,6 +1,8 @@ module.exports = { verbose: true, + testEnvironment: 'jsdom', + setupFiles: ['./tests/setup.js'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], diff --git a/components/avatar/__tests__/index.test.tsx b/components/avatar/__tests__/index.test.tsx index a1655b8d5..f7f3d4976 100644 --- a/components/avatar/__tests__/index.test.tsx +++ b/components/avatar/__tests__/index.test.tsx @@ -52,6 +52,6 @@ describe('Avatar', () => { const count = 20 const group = render() const text = group.find('.count').text() - expect(text).toContain(count) + expect(text).toMatch(`${count}`) }) }) diff --git a/package.json b/package.json index a102b9173..770bff28d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@geist-ui/react", - "version": "2.2.0-rc.6", + "version": "2.2.0-dev.2", "main": "dist/index.js", "module": "esm/index.js", "types": "dist/index.d.ts", @@ -48,12 +48,12 @@ "/esm" ], "devDependencies": { - "@babel/cli": "^7.8.4", - "@babel/plugin-transform-runtime": "^7.9.0", - "@babel/preset-env": "^7.12.16", - "@babel/preset-react": "^7.12.13", - "@babel/preset-typescript": "^7.8.3", - "@babel/runtime": "^7.12.13", + "@babel/cli": "^7.14.5", + "@babel/plugin-transform-runtime": "^7.14.5", + "@babel/preset-env": "^7.14.7", + "@babel/preset-react": "^7.14.5", + "@babel/preset-typescript": "^7.14.5", + "@babel/runtime": "^7.14.6", "@geist-ui/prettier-config": "^1.0.1", "@geist-ui/react-icons": "^1.0.1", "@mapbox/rehype-prism": "^0.6.0", @@ -69,8 +69,8 @@ "@typescript-eslint/eslint-plugin": "^4.27.0", "@typescript-eslint/parser": "^4.27.0", "@wojtekmaj/enzyme-adapter-react-17": "^0.6.2", - "babel-jest": "^25.3.0", - "babel-loader": "^8.0.6", + "babel-jest": "^27.0.5", + "babel-loader": "^8.2.2", "css-mediaquery": "^0.1.2", "enzyme": "^3.11.0", "eslint": "^7.29.0", @@ -78,9 +78,9 @@ "eslint-config-ts-lambdas": "^1.2.3", "eslint-plugin-react": "^7.22.0", "extract-mdx-metadata": "^1.0.0", - "fs-extra": "^8.1.0", - "inter-ui": "^3.15.0", - "jest": "^25.3.0", + "fs-extra": "^10.0.0", + "inter-ui": "^3.19.2", + "jest": "^27.0.5", "next": "^11.0.0", "prettier": "^2.3.1", "react": "^17.0.2", @@ -97,5 +97,9 @@ }, "dependencies": { "styled-jsx": "^3.4.4" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" } }