From 40655fffe2a239de67730af9eb0b04af50bfce89 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Wed, 4 Oct 2023 23:25:44 +0800 Subject: [PATCH] test: modify jest config. --- core/README.md | 4 ++-- core/package.json | 4 +--- core/src/__tests__/index.test.tsx | 3 --- example/nextjs/package.json | 24 ++++++++++++------------ package.json | 8 +++----- 5 files changed, 18 insertions(+), 25 deletions(-) diff --git a/core/README.md b/core/README.md index 923d36ec1..4b64c19cc 100644 --- a/core/README.md +++ b/core/README.md @@ -53,8 +53,8 @@ npm install @uiw/react-codemirror --save | [`@uiw/codemirror-extensions-zebra-stripes`](https://uiwjs.github.io/react-codemirror/#/extensions/zebra-stripes) | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-extensions-zebra-stripes.svg)](https://www.npmjs.com/package/@uiw/codemirror-extensions-zebra-stripes) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-extensions-zebra-stripes.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-extensions-zebra-stripes) | | [`@uiw/codemirror-themes`](https://uiwjs.github.io/react-codemirror/#/theme/doc) | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-themes.svg)](https://www.npmjs.com/package/@uiw/codemirror-themes) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-themes.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-themes) | -| Name | NPM Version | Website | -| :----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| Name | NPM Version | +| :----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [`@uiw/codemirror-themes-all`](https://uiwjs.github.io/react-codemirror/#/theme/all) | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-themes-all.svg)](https://www.npmjs.com/package/@uiw/codemirror-themes-all) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-themes-all.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-themes-all) | | [`@uiw/codemirror-theme-abcdef`](https://uiwjs.github.io/react-codemirror/#/theme/data/abcdef) | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-abcdef.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-abcdef) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-abcdef.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-abcdef) | | [`@uiw/codemirror-theme-abyss`](https://uiwjs.github.io/react-codemirror/#/theme/data/abyss) | [![npm version](https://img.shields.io/npm/v/@uiw/codemirror-theme-abyss.svg)](https://www.npmjs.com/package/@uiw/codemirror-theme-abyss) [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/codemirror-theme-abyss.svg?style=flat)](https://www.npmjs.com/package/@uiw/codemirror-theme-abyss) | diff --git a/core/package.json b/core/package.json index 493a1dd3c..6788d48f8 100644 --- a/core/package.json +++ b/core/package.json @@ -12,9 +12,7 @@ "bundle:watch": "ncc watch src/index.tsx --target web --filename codemirror", "bundle:min": "ncc build src/index.tsx --target web --filename codemirror --minify", "watch": "tsbb watch src/*.tsx --use-babel", - "build": "tsbb build src/*.tsx --use-babel", - "test": "tsbb test --env=jsdom", - "coverage": "tsbb test --env=jsdom --coverage --bail" + "build": "tsbb build src/*.tsx --use-babel" }, "repository": { "type": "git", diff --git a/core/src/__tests__/index.test.tsx b/core/src/__tests__/index.test.tsx index bce264810..e9ca083bf 100644 --- a/core/src/__tests__/index.test.tsx +++ b/core/src/__tests__/index.test.tsx @@ -1,6 +1,3 @@ -/** - * @jest-environment jsdom - */ /* eslint-disable jest/no-conditional-expect */ import React, { useEffect, useRef } from 'react'; import renderer from 'react-test-renderer'; diff --git a/example/nextjs/package.json b/example/nextjs/package.json index 95dca2141..d5e93a149 100644 --- a/example/nextjs/package.json +++ b/example/nextjs/package.json @@ -9,18 +9,18 @@ "lint": "next lint" }, "dependencies": { - "@types/node": "20.6.2", - "@types/react": "18.2.22", - "@types/react-dom": "18.2.7", - "autoprefixer": "10.4.15", - "eslint": "8.49.0", - "eslint-config-next": "13.5.1", - "next": "13.5.1", - "postcss": "8.4.30", - "react": "18.2.0", - "react-dom": "18.2.0", - "tailwindcss": "3.3.3", - "typescript": "5.2.2" + "@types/node": "~20.8.2", + "@types/react": "^18.2.24", + "@types/react-dom": "^18.2.9", + "autoprefixer": "~10.4.16", + "eslint": "~8.50.0", + "eslint-config-next": "~13.5.4", + "next": "~13.5.4", + "postcss": "~8.4.31", + "react": "~18.2.0", + "react-dom": "~18.2.0", + "tailwindcss": "~3.3.3", + "typescript": "~5.2.2" }, "devDependencies": { "@uiw/react-codemirror": "4.21.19", diff --git a/package.json b/package.json index 2c7119612..7ee66fbed 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "doc": "npm run-script build --workspace www", "start": "npm run-script start --workspace www", "⬆️⬆️⬆️⬆️⬆️ package ⬆️⬆️⬆️⬆️⬆️": "▲▲▲▲▲ package ▲▲▲▲▲", + "test": "lerna exec \"tsbb test\" --scope @uiw/react-codemirror", + "coverage": "lerna exec \"tsbb test --coverage --bail\" --scope @uiw/react-codemirror", "prepare": "husky install", "version": "lerna version --exact --force-publish --no-push --no-git-tag-version", "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,json}'", @@ -30,15 +32,11 @@ "@kkt/ncc": "^1.0.13", "@types/react-test-renderer": "~18.0.0", "husky": "~8.0.0", - "jest": "^29.5.0", - "jest-environment-jsdom": "^29.5.0", - "jest-environment-node": "^29.5.0", - "jest-watch-typeahead": "^2.2.2", "kkt": "^7.2.0", "lerna": "^7.0.0", "lint-staged": "^14.0.1", "prettier": "^3.0.2", "react-test-renderer": "~18.2.0", - "tsbb": "^4.1.5" + "tsbb": "^4.2.3" } }