mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
chore: remove __DEV__ with ts-jest (#1598)
* wip: use ts-jest instead of swc/jest * use esm in jest * remove types/jest * remove __DEV__ * fix rollup config * fix github workflow * hack jest.Mock * wip: ts * skipLibCheck for older ts 2 * wip: ts * wip: workflow... * wip: workflow... * wip: workflow... * experiment... * experiment...2 * experiment...3 * experiment...4 * jest preset
This commit is contained in:
parent
6d0cb03eb9
commit
9062ca634f
@ -113,12 +113,6 @@
|
||||
"project": "./tsconfig.json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["tests/**/*.tsx"],
|
||||
"env": {
|
||||
"jest/globals": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["./*.js"],
|
||||
"rules": {
|
||||
|
||||
8
.github/workflows/test-multiple-builds.yml
vendored
8
.github/workflows/test-multiple-builds.yml
vendored
@ -30,11 +30,13 @@ jobs:
|
||||
- name: Patch for DEV-ONLY
|
||||
if: ${{ matrix.env == 'development' }}
|
||||
run: |
|
||||
sed -i~ "s/it[a-zA-Z]*('\[PRD-ONLY\]/it.skip('/" tests/*.tsx
|
||||
sed -i~ "s/it[.a-zA-Z]*('\[DEV-ONLY\]/it('/" tests/*.tsx
|
||||
sed -i~ "s/it[.a-zA-Z]*('\[PRD-ONLY\]/it.skip('/" tests/*.tsx
|
||||
- name: Patch for PRD-ONLY
|
||||
if: ${{ matrix.env == 'production' }}
|
||||
run: |
|
||||
sed -i~ "s/it[a-zA-Z]*('\[DEV-ONLY\]/it.skip('/" tests/*.tsx
|
||||
sed -i~ "s/it[.a-zA-Z]*('\[PRD-ONLY\]/it('/" tests/*.tsx
|
||||
sed -i~ "s/it[.a-zA-Z]*('\[DEV-ONLY\]/it.skip('/" tests/*.tsx
|
||||
- name: Patch for CJS
|
||||
if: ${{ matrix.build == 'cjs' }}
|
||||
run: |
|
||||
@ -50,12 +52,12 @@ jobs:
|
||||
if: ${{ matrix.build == 'umd' || matrix.build == 'system' }}
|
||||
run: |
|
||||
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/${BUILD}\1.${NODE_ENV}.js/" package.json
|
||||
sed -i~ 's/"test:ci":.*,$/"test:ci": "jest",/' package.json
|
||||
env:
|
||||
BUILD: ${{ matrix.build }}
|
||||
NODE_ENV: ${{ matrix.env }}
|
||||
- name: Test ${{ matrix.build }} ${{ matrix.env }}
|
||||
run: |
|
||||
cat package.json
|
||||
yarn test:ci
|
||||
env:
|
||||
NODE_ENV: ${{ matrix.env }}
|
||||
|
||||
5
.github/workflows/test-multiple-versions.yml
vendored
5
.github/workflows/test-multiple-versions.yml
vendored
@ -50,8 +50,9 @@ jobs:
|
||||
if: ${{ startsWith(matrix.react, '16.') }}
|
||||
run: |
|
||||
sed -i~ '1s/^/import React from "react";/' tests/*.tsx
|
||||
sed -i~ 's/automatic/classic/' babel.config.js
|
||||
sed -i~ 's/automatic/classic/' .swcrc
|
||||
sed -i~ 's/"jsx": "react-jsx"/"jsx": "react"/' tsconfig.json
|
||||
sed -i~ 's/import\.meta\.env[?]\.MODE/"DEVELOPMENT".toLowerCase()/' src/*.ts src/*/*.ts
|
||||
sed -i~ 's/"test:ci":.*,$/"test:ci": "jest",/' package.json
|
||||
- name: Test ${{ matrix.react }}
|
||||
run: |
|
||||
yarn add -D react@${{ matrix.react }} react-dom@${{ matrix.react }}
|
||||
|
||||
18
.github/workflows/test-old-typescript.yml
vendored
18
.github/workflows/test-old-typescript.yml
vendored
@ -32,18 +32,14 @@ jobs:
|
||||
- run: yarn build
|
||||
- name: Patch for Old TS
|
||||
run: |
|
||||
sed -i~ "s/\/\/ @ts-expect-error.*\[LATEST-TS-ONLY\]//" tests/*.tsx
|
||||
sed -i~ "s/\"exactOptionalPropertyTypes\": true,//" tsconfig.json
|
||||
sed -i~ "s/\"zustand\": \[\"\.\/src\/index\.ts\"\],/\"zustand\": [\".\/dist\/index.d.ts\"],/" tsconfig.json
|
||||
sed -i~ "s/\"zustand\/\*\": \[\"\.\/src\/\*\.ts\"\]/\"zustand\/*\": [\".\/dist\/*.d.ts\"]/" tsconfig.json
|
||||
sed -i~ "s/\"include\": .*/\"include\": [\"src\/types.d.ts\", \"dist\/**\/*\", \"tests\/**\/*\"],/" tsconfig.json
|
||||
- name: Patch for Older TS
|
||||
if: ${{ matrix.typescript == '4.2.3' || matrix.typescript == '4.1.5' }}
|
||||
run: |
|
||||
yarn json -I -f package.json -e "this.resolutions['@types/jest']='29.2.0';"
|
||||
yarn add -D @types/jest@29.2.0
|
||||
sed -i~ 's/\/\/ @ts-expect-error.*\[LATEST-TS-ONLY\]//' tests/*.tsx
|
||||
sed -i~ 's/"target":/"skipLibCheck":true,"target":/' tsconfig.json
|
||||
sed -i~ 's/"exactOptionalPropertyTypes": true,//' tsconfig.json
|
||||
sed -i~ 's/"zustand": \["\.\/src\/index\.ts"\],/"zustand": [".\/dist\/index.d.ts"],/' tsconfig.json
|
||||
sed -i~ 's/"zustand\/\*": \["\.\/src\/\*\.ts"\]/"zustand\/*": [".\/dist\/*.d.ts"]/' tsconfig.json
|
||||
sed -i~ 's/"include": .*/"include": ["src\/types.d.ts", "dist\/**\/*", "tests\/**\/*"],/' tsconfig.json
|
||||
- name: Test ${{ matrix.typescript }}
|
||||
run: |
|
||||
yarn add -D typescript@${{ matrix.typescript }}
|
||||
rm -r node_modules/@types/jsdom node_modules/parse5 node_modules/@types/prettier
|
||||
rm -r node_modules/parse5
|
||||
yarn tsc --noEmit
|
||||
|
||||
19
.swcrc
19
.swcrc
@ -1,19 +0,0 @@
|
||||
{
|
||||
"jsc": {
|
||||
"target": "es5",
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true
|
||||
},
|
||||
"transform": {
|
||||
"react": {
|
||||
"runtime": "automatic",
|
||||
"pragma": "React.createElement",
|
||||
"pragmaFrag": "React.Fragment",
|
||||
"throwIfNamespace": true,
|
||||
"useBuiltins": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceMaps": true
|
||||
}
|
||||
28
package.json
28
package.json
@ -91,10 +91,10 @@
|
||||
"eslint": "eslint --fix '*.{js,json}' '{src,tests}/**/*.{ts,tsx}'",
|
||||
"eslint:ci": "eslint '*.{js,json}' '{src,tests}/**/*.{ts,tsx}'",
|
||||
"pretest": "tsc --noEmit",
|
||||
"test": "jest",
|
||||
"test:ci": "jest",
|
||||
"test:dev": "jest --watch --no-coverage",
|
||||
"test:coverage:watch": "jest --watch",
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
||||
"test:ci": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
||||
"test:dev": "yarn node --experimental-vm-modules $(yarn bin jest) --watch --no-coverage",
|
||||
"test:coverage:watch": "yarn node --experimental-vm-modules $(yarn bin jest) --watch",
|
||||
"copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/src && shx rm -rf dist/{src,tests} && downlevel-dts dist dist/ts3.4 && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined; this.jest=undefined;\"",
|
||||
"patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').copyFileSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\""
|
||||
},
|
||||
@ -134,14 +134,19 @@
|
||||
"jest": {
|
||||
"rootDir": ".",
|
||||
"testEnvironment": "jsdom",
|
||||
"preset": "ts-jest/presets/default-esm",
|
||||
"transform": {
|
||||
"^.+\\.(t|j)sx?$": [
|
||||
"@swc/jest"
|
||||
"ts-jest",
|
||||
{
|
||||
"useESM": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"globals": {
|
||||
"__DEV__": true
|
||||
},
|
||||
"extensionsToTreatAsEsm": [
|
||||
".ts",
|
||||
".tsx"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^zustand$": "<rootDir>/src/index.ts",
|
||||
"^zustand/(.*)$": "<rootDir>/src/$1.ts"
|
||||
@ -180,10 +185,7 @@
|
||||
"@rollup/plugin-replace": "^5.0.2",
|
||||
"@rollup/plugin-terser": "^0.3.0",
|
||||
"@rollup/plugin-typescript": "^11.0.0",
|
||||
"@swc/core": "^1.3.26",
|
||||
"@swc/jest": "^0.2.24",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@types/jest": "^29.2.5",
|
||||
"@types/react": "^18.0.26",
|
||||
"@types/react-dom": "^18.0.10",
|
||||
"@types/use-sync-external-store": "^0.0.3",
|
||||
@ -211,11 +213,9 @@
|
||||
"rollup": "^3.10.0",
|
||||
"rollup-plugin-esbuild": "^5.0.0",
|
||||
"shx": "^0.3.4",
|
||||
"ts-jest": "^29.0.5",
|
||||
"typescript": "^4.9.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"date-fns": "2.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"immer": ">=9.0",
|
||||
"react": ">=16.8"
|
||||
|
||||
@ -62,12 +62,15 @@ function createESMConfig(input, output) {
|
||||
}),
|
||||
resolve({ extensions }),
|
||||
replace({
|
||||
__DEV__: output.endsWith('.mjs')
|
||||
? '((import.meta.env&&import.meta.env.MODE)!=="production")'
|
||||
: '(process.env.NODE_ENV!=="production")',
|
||||
...(output.endsWith('.js')
|
||||
? {
|
||||
'import.meta.env?.MODE': 'process.env.NODE_ENV',
|
||||
}
|
||||
: {}),
|
||||
// a workround for #829
|
||||
'use-sync-external-store/shim/with-selector':
|
||||
'use-sync-external-store/shim/with-selector.js',
|
||||
delimiters: ['\\b', '\\b(?!(\\.|/))'],
|
||||
preventAssignment: true,
|
||||
}),
|
||||
getEsbuild('node12'),
|
||||
@ -95,7 +98,8 @@ function createCommonJSConfig(input, output, options) {
|
||||
}),
|
||||
resolve({ extensions }),
|
||||
replace({
|
||||
__DEV__: '(process.env.NODE_ENV!=="production")',
|
||||
'import.meta.env?.MODE': 'process.env.NODE_ENV',
|
||||
delimiters: ['\\b', '\\b(?!(\\.|/))'],
|
||||
preventAssignment: true,
|
||||
}),
|
||||
babelPlugin(getBabelOptions({ ie: 11 })),
|
||||
@ -131,7 +135,8 @@ function createUMDConfig(input, output, env) {
|
||||
}),
|
||||
resolve({ extensions }),
|
||||
replace({
|
||||
__DEV__: env !== 'production' ? 'true' : 'false',
|
||||
'import.meta.env?.MODE': JSON.stringify(env),
|
||||
delimiters: ['\\b', '\\b(?!(\\.|/))'],
|
||||
preventAssignment: true,
|
||||
}),
|
||||
babelPlugin(getBabelOptions({ ie: 11 })),
|
||||
@ -156,7 +161,8 @@ function createSystemConfig(input, output, env) {
|
||||
}),
|
||||
resolve({ extensions }),
|
||||
replace({
|
||||
__DEV__: env !== 'production' ? 'true' : 'false',
|
||||
'import.meta.env?.MODE': JSON.stringify(env),
|
||||
delimiters: ['\\b', '\\b(?!(\\.|/))'],
|
||||
preventAssignment: true,
|
||||
}),
|
||||
getEsbuild('node12', env),
|
||||
|
||||
@ -25,7 +25,7 @@ type WithoutCallSignature<T> = { [K in keyof T]: T[K] }
|
||||
* @deprecated Use `createStore` and `useStore` for context usage
|
||||
*/
|
||||
function createContext<S extends StoreApi<unknown>>() {
|
||||
if (__DEV__) {
|
||||
if (import.meta.env?.MODE !== 'production') {
|
||||
console.warn(
|
||||
"[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180."
|
||||
)
|
||||
|
||||
@ -210,13 +210,14 @@ const devtoolsImpl: DevtoolsImpl =
|
||||
| false
|
||||
try {
|
||||
extensionConnector =
|
||||
(enabled ?? __DEV__) && window.__REDUX_DEVTOOLS_EXTENSION__
|
||||
(enabled ?? import.meta.env?.MODE !== 'production') &&
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__
|
||||
} catch (e) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
if (!extensionConnector) {
|
||||
if (__DEV__ && enabled) {
|
||||
if (import.meta.env?.MODE !== 'production' && enabled) {
|
||||
console.warn(
|
||||
'[zustand devtools middleware] Please install/enable Redux devtools extension'
|
||||
)
|
||||
@ -286,7 +287,7 @@ const devtoolsImpl: DevtoolsImpl =
|
||||
const originalDispatch = (api as any).dispatch
|
||||
;(api as any).dispatch = (...a: any[]) => {
|
||||
if (
|
||||
__DEV__ &&
|
||||
import.meta.env?.MODE !== 'production' &&
|
||||
a[0].type === '__setState' &&
|
||||
!didWarnAboutReservedActionType
|
||||
) {
|
||||
|
||||
@ -502,7 +502,7 @@ const persistImpl: PersistImpl = (config, baseOptions) => {
|
||||
'serialize' in baseOptions ||
|
||||
'deserialize' in baseOptions
|
||||
) {
|
||||
if (__DEV__) {
|
||||
if (import.meta.env?.MODE !== 'production') {
|
||||
console.warn(
|
||||
'[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.'
|
||||
)
|
||||
|
||||
@ -68,7 +68,10 @@ type Create = {
|
||||
}
|
||||
|
||||
const createImpl = <T>(createState: StateCreator<T, [], []>) => {
|
||||
if (__DEV__ && typeof createState !== 'function') {
|
||||
if (
|
||||
import.meta.env?.MODE !== 'production' &&
|
||||
typeof createState !== 'function'
|
||||
) {
|
||||
console.warn(
|
||||
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."
|
||||
)
|
||||
@ -91,7 +94,7 @@ export const create = (<T>(createState: StateCreator<T, [], []> | undefined) =>
|
||||
* @deprecated Use `import { create } from 'zustand'`
|
||||
*/
|
||||
export default ((createState: any) => {
|
||||
if (__DEV__) {
|
||||
if (import.meta.env?.MODE !== 'production') {
|
||||
console.warn(
|
||||
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`."
|
||||
)
|
||||
|
||||
@ -52,7 +52,7 @@ export function shallow<T>(objA: T, objB: T) {
|
||||
* @deprecated Use `import { shallow } from 'zustand/shallow'`
|
||||
*/
|
||||
export default ((objA, objB) => {
|
||||
if (__DEV__) {
|
||||
if (import.meta.env?.MODE !== 'production') {
|
||||
console.warn(
|
||||
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand/shallow'`."
|
||||
)
|
||||
|
||||
7
src/types.d.ts
vendored
7
src/types.d.ts
vendored
@ -1,2 +1,5 @@
|
||||
// eslint-disable-next-line no-var
|
||||
declare var __DEV__: boolean
|
||||
declare interface ImportMeta {
|
||||
env?: {
|
||||
MODE: string
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ const createStoreImpl: CreateStoreImpl = (createState) => {
|
||||
}
|
||||
|
||||
const destroy: StoreApi<TState>['destroy'] = () => {
|
||||
if (__DEV__) {
|
||||
if (import.meta.env?.MODE !== 'production') {
|
||||
console.warn(
|
||||
'[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.'
|
||||
)
|
||||
@ -109,7 +109,7 @@ export const createStore = ((createState) =>
|
||||
* @deprecated Use `import { createStore } from 'zustand/vanilla'`
|
||||
*/
|
||||
export default ((createState) => {
|
||||
if (__DEV__) {
|
||||
if (import.meta.env?.MODE !== 'production') {
|
||||
console.warn(
|
||||
"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."
|
||||
)
|
||||
|
||||
@ -6,6 +6,7 @@ import {
|
||||
useLayoutEffect,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { afterEach, expect, it, jest } from '@jest/globals'
|
||||
import { act, fireEvent, render } from '@testing-library/react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { create } from 'zustand'
|
||||
|
||||
@ -6,6 +6,7 @@ import {
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { afterEach, it, jest } from '@jest/globals'
|
||||
import { render } from '@testing-library/react'
|
||||
import { create } from 'zustand'
|
||||
import type { StoreApi } from 'zustand'
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
import {
|
||||
afterEach,
|
||||
beforeEach,
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
jest,
|
||||
} from '@jest/globals'
|
||||
import { StoreApi } from 'zustand/vanilla'
|
||||
|
||||
const getImports = async () => {
|
||||
@ -20,12 +28,12 @@ type TupleOfEqualLength<Arr extends unknown[], T> = number extends Arr['length']
|
||||
type Connection = {
|
||||
subscribers: ((message: unknown) => void)[]
|
||||
api: {
|
||||
subscribe: jest.Mock<() => void, [f: any]>
|
||||
unsubscribe: jest.Mock<any, any>
|
||||
send: jest.Mock<any, any>
|
||||
init: jest.Mock<any, any>
|
||||
error: jest.Mock<any, any>
|
||||
dispatch?: jest.Mock<any, any>
|
||||
subscribe: jest.Mock<(f: (message: unknown) => void) => void>
|
||||
unsubscribe: jest.Mock<any>
|
||||
send: jest.Mock<any>
|
||||
init: jest.Mock<any>
|
||||
error: jest.Mock<any>
|
||||
dispatch?: jest.Mock<any>
|
||||
}
|
||||
}
|
||||
const namedConnections = new Map<string | undefined, Connection>()
|
||||
@ -86,7 +94,7 @@ function getKeyFromOptions(options: any): string | undefined {
|
||||
}
|
||||
|
||||
const extensionConnector = {
|
||||
connect: jest.fn((options) => {
|
||||
connect: jest.fn((options: any) => {
|
||||
const key = getKeyFromOptions(options)
|
||||
//console.log('options', options)
|
||||
const areNameUndefinedMapsNeeded =
|
||||
@ -96,7 +104,7 @@ const extensionConnector = {
|
||||
: namedConnections
|
||||
const subscribers: Connection['subscribers'] = []
|
||||
const api = {
|
||||
subscribe: jest.fn((f) => {
|
||||
subscribe: jest.fn((f: (m: unknown) => void) => {
|
||||
subscribers.push(f)
|
||||
return () => {}
|
||||
}),
|
||||
@ -138,16 +146,13 @@ it('connects to the extension by passing the options and initializes', async ()
|
||||
|
||||
describe('If there is no extension installed...', () => {
|
||||
let savedConsoleWarn: any
|
||||
let savedDEV: boolean
|
||||
beforeEach(() => {
|
||||
savedConsoleWarn = console.warn
|
||||
console.warn = jest.fn()
|
||||
savedDEV = __DEV__
|
||||
;(window as any).__REDUX_DEVTOOLS_EXTENSION__ = undefined
|
||||
})
|
||||
afterEach(() => {
|
||||
console.warn = savedConsoleWarn
|
||||
__DEV__ = savedDEV
|
||||
;(window as any).__REDUX_DEVTOOLS_EXTENSION__ = extensionConnector
|
||||
})
|
||||
|
||||
@ -166,21 +171,18 @@ describe('If there is no extension installed...', () => {
|
||||
|
||||
it('[DEV-ONLY] warns if enabled in dev mode', async () => {
|
||||
const { devtools, createStore } = await getImports()
|
||||
__DEV__ = true
|
||||
createStore(devtools(() => ({ count: 0 }), { enabled: true }))
|
||||
expect(console.warn).toBeCalled()
|
||||
})
|
||||
|
||||
it('[PRD-ONLY] does not warn if not in dev env', async () => {
|
||||
it.skip('[PRD-ONLY] does not warn if not in dev env', async () => {
|
||||
const { devtools, createStore } = await getImports()
|
||||
__DEV__ = false
|
||||
createStore(devtools(() => ({ count: 0 })))
|
||||
expect(console.warn).not.toBeCalled()
|
||||
})
|
||||
|
||||
it('[PRD-ONLY] does not warn if not in dev env even if enabled', async () => {
|
||||
it.skip('[PRD-ONLY] does not warn if not in dev env even if enabled', async () => {
|
||||
const { devtools, createStore } = await getImports()
|
||||
__DEV__ = false
|
||||
createStore(devtools(() => ({ count: 0 }), { enabled: true }))
|
||||
expect(console.warn).not.toBeCalled()
|
||||
})
|
||||
@ -637,11 +639,22 @@ describe('with redux middleware', () => {
|
||||
payload: JSON.stringify({ type: 'DECREMENT' }),
|
||||
})
|
||||
|
||||
expect(connection.init.mock.calls).toMatchObject([[{ count: 0 }]])
|
||||
expect(connection.init.mock.calls).toMatchObject([
|
||||
[{ count: 0 }] as unknown as Record<string, unknown>,
|
||||
])
|
||||
expect(connection.send.mock.calls).toMatchObject([
|
||||
[{ type: 'INCREMENT' }, { count: 1 }],
|
||||
[{ type: 'INCREMENT' }, { count: 2 }],
|
||||
[{ type: 'DECREMENT' }, { count: 1 }],
|
||||
[{ type: 'INCREMENT' }, { count: 1 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
[{ type: 'INCREMENT' }, { count: 2 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
[{ type: 'DECREMENT' }, { count: 1 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
])
|
||||
expect(api.getState()).toMatchObject({ count: 1 })
|
||||
})
|
||||
@ -1008,17 +1021,39 @@ describe('when redux connection was called on multiple stores with `name` provid
|
||||
payload: JSON.stringify({ type: 'DECREMENT' }),
|
||||
})
|
||||
|
||||
expect(connection1.init.mock.calls).toMatchObject([[{ count: 0 }]])
|
||||
expect(connection2.init.mock.calls).toMatchObject([[{ count: 10 }]])
|
||||
expect(connection1.init.mock.calls).toMatchObject([
|
||||
[{ count: 0 }] as unknown as Record<string, unknown>,
|
||||
])
|
||||
expect(connection2.init.mock.calls).toMatchObject([
|
||||
[{ count: 10 }] as unknown as Record<string, unknown>,
|
||||
])
|
||||
expect(connection1.send.mock.calls).toMatchObject([
|
||||
[{ type: 'INCREMENT' }, { count: 1 }],
|
||||
[{ type: 'INCREMENT' }, { count: 2 }],
|
||||
[{ type: 'DECREMENT' }, { count: 1 }],
|
||||
[{ type: 'INCREMENT' }, { count: 1 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
[{ type: 'INCREMENT' }, { count: 2 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
[{ type: 'DECREMENT' }, { count: 1 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
])
|
||||
expect(connection2.send.mock.calls).toMatchObject([
|
||||
[{ type: 'INCREMENT' }, { count: 11 }],
|
||||
[{ type: 'INCREMENT' }, { count: 12 }],
|
||||
[{ type: 'DECREMENT' }, { count: 11 }],
|
||||
[{ type: 'INCREMENT' }, { count: 11 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
[{ type: 'INCREMENT' }, { count: 12 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>,
|
||||
[{ type: 'DECREMENT' }, { count: 11 }] as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
> as unknown as Record<string, unknown>,
|
||||
])
|
||||
expect(api1.getState()).toMatchObject({ count: 1 })
|
||||
expect(api2.getState()).toMatchObject({ count: 11 })
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { describe, it } from '@jest/globals'
|
||||
import { create } from 'zustand'
|
||||
import type { StoreApi } from 'zustand'
|
||||
import {
|
||||
@ -35,14 +36,6 @@ describe('counter state spec (no middleware)', () => {
|
||||
})
|
||||
|
||||
describe('counter state spec (single middleware)', () => {
|
||||
let savedDEV: boolean
|
||||
beforeEach(() => {
|
||||
savedDEV = __DEV__
|
||||
})
|
||||
afterEach(() => {
|
||||
__DEV__ = savedDEV
|
||||
})
|
||||
|
||||
it('immer', () => {
|
||||
const useBoundStore = create<CounterState>()(
|
||||
immer((set, get) => ({
|
||||
@ -98,7 +91,6 @@ describe('counter state spec (single middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
devtools(
|
||||
(set, get) => ({
|
||||
@ -252,16 +244,7 @@ describe('counter state spec (single middleware)', () => {
|
||||
})
|
||||
|
||||
describe('counter state spec (double middleware)', () => {
|
||||
let savedDEV: boolean
|
||||
beforeEach(() => {
|
||||
savedDEV = __DEV__
|
||||
})
|
||||
afterEach(() => {
|
||||
__DEV__ = savedDEV
|
||||
})
|
||||
|
||||
it('immer & devtools', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
immer(
|
||||
devtools(
|
||||
@ -294,7 +277,6 @@ describe('counter state spec (double middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools & redux', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create(
|
||||
devtools(
|
||||
redux(
|
||||
@ -323,7 +305,6 @@ describe('counter state spec (double middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools & combine', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create(
|
||||
devtools(
|
||||
combine({ count: 1 }, (set, get) => ({
|
||||
@ -370,7 +351,6 @@ describe('counter state spec (double middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools & subscribeWithSelector', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
devtools(
|
||||
subscribeWithSelector((set, get) => ({
|
||||
@ -398,7 +378,6 @@ describe('counter state spec (double middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools & persist', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
devtools(
|
||||
persist(
|
||||
@ -427,16 +406,7 @@ describe('counter state spec (double middleware)', () => {
|
||||
})
|
||||
|
||||
describe('counter state spec (triple middleware)', () => {
|
||||
let savedDEV: boolean
|
||||
beforeEach(() => {
|
||||
savedDEV = __DEV__
|
||||
})
|
||||
afterEach(() => {
|
||||
__DEV__ = savedDEV
|
||||
})
|
||||
|
||||
it('devtools & persist & immer', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
devtools(
|
||||
persist(
|
||||
@ -467,7 +437,6 @@ describe('counter state spec (triple middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools & subscribeWithSelector & combine', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create(
|
||||
devtools(
|
||||
subscribeWithSelector(
|
||||
@ -496,7 +465,6 @@ describe('counter state spec (triple middleware)', () => {
|
||||
})
|
||||
|
||||
it('devtools & subscribeWithSelector & persist', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
devtools(
|
||||
subscribeWithSelector(
|
||||
@ -531,16 +499,7 @@ describe('counter state spec (triple middleware)', () => {
|
||||
})
|
||||
|
||||
describe('counter state spec (quadruple middleware)', () => {
|
||||
let savedDEV: boolean
|
||||
beforeEach(() => {
|
||||
savedDEV = __DEV__
|
||||
})
|
||||
afterEach(() => {
|
||||
__DEV__ = savedDEV
|
||||
})
|
||||
|
||||
it('devtools & subscribeWithSelector & persist & immer (#616)', () => {
|
||||
__DEV__ = false
|
||||
const useBoundStore = create<CounterState>()(
|
||||
devtools(
|
||||
subscribeWithSelector(
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { StrictMode, useEffect } from 'react'
|
||||
import { afterEach, describe, expect, it, jest } from '@jest/globals'
|
||||
import { act, render, waitFor } from '@testing-library/react'
|
||||
import { create } from 'zustand'
|
||||
import { createJSONStorage, persist } from 'zustand/middleware'
|
||||
@ -190,7 +191,7 @@ describe('persist middleware with async configuration', () => {
|
||||
})
|
||||
|
||||
it('can migrate persisted state', async () => {
|
||||
const setItemSpy = jest.fn()
|
||||
const setItemSpy = jest.fn<() => void>()
|
||||
const onRehydrateStorageSpy = jest.fn()
|
||||
const migrateSpy = jest.fn(() => ({ count: 99 }))
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { afterEach, describe, expect, it, jest } from '@jest/globals'
|
||||
import { create } from 'zustand'
|
||||
import { createJSONStorage, persist } from 'zustand/middleware'
|
||||
|
||||
@ -130,7 +131,7 @@ describe('persist middleware with sync configuration', () => {
|
||||
})
|
||||
|
||||
it('can migrate persisted state', () => {
|
||||
const setItemSpy = jest.fn()
|
||||
const setItemSpy = jest.fn<() => void>()
|
||||
const onRehydrateStorageSpy = jest.fn()
|
||||
const migrateSpy = jest.fn(() => ({ count: 99 }))
|
||||
|
||||
@ -319,7 +320,7 @@ describe('persist middleware with sync configuration', () => {
|
||||
})
|
||||
|
||||
it('can filter the persisted value', () => {
|
||||
const setItemSpy = jest.fn()
|
||||
const setItemSpy = jest.fn<() => void>()
|
||||
|
||||
const storage = {
|
||||
getItem: () => '',
|
||||
@ -386,7 +387,7 @@ describe('persist middleware with sync configuration', () => {
|
||||
it('can access the options through the api', () => {
|
||||
const storage = {
|
||||
getItem: () => null,
|
||||
setItem: jest.fn(),
|
||||
setItem: jest.fn<() => void>(),
|
||||
removeItem: () => {},
|
||||
}
|
||||
|
||||
@ -401,7 +402,7 @@ describe('persist middleware with sync configuration', () => {
|
||||
})
|
||||
|
||||
it('can change the options through the api', () => {
|
||||
const setItemSpy = jest.fn()
|
||||
const setItemSpy = jest.fn<() => void>()
|
||||
|
||||
const storage = {
|
||||
getItem: () => null,
|
||||
@ -438,7 +439,7 @@ describe('persist middleware with sync configuration', () => {
|
||||
})
|
||||
|
||||
it('can clear the storage through the api', () => {
|
||||
const removeItemSpy = jest.fn()
|
||||
const removeItemSpy = jest.fn<() => void>()
|
||||
|
||||
const storage = {
|
||||
getItem: () => null,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { describe, expect, it } from '@jest/globals'
|
||||
import { create } from 'zustand'
|
||||
import { shallow } from 'zustand/shallow'
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { describe, expect, it, jest } from '@jest/globals'
|
||||
import { create } from 'zustand'
|
||||
import { subscribeWithSelector } from 'zustand/middleware'
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { expect, it } from '@jest/globals'
|
||||
import { create } from 'zustand'
|
||||
import type {
|
||||
StateCreator,
|
||||
|
||||
204
yarn.lock
204
yarn.lock
@ -1182,13 +1182,6 @@
|
||||
slash "^3.0.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
"@jest/create-cache-key-function@^27.4.2":
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-27.5.1.tgz#7448fae15602ea95c828f5eceed35c202a820b31"
|
||||
integrity sha512-dmH1yW+makpTSURTy8VzdUwFnfQh1G8R+DxO2Ho2FFmBbKFEVm+3jWdvFhE2VqB/LATCTokkP0dotjyQyw5/AQ==
|
||||
dependencies:
|
||||
"@jest/types" "^27.5.1"
|
||||
|
||||
"@jest/environment@^29.3.1":
|
||||
version "29.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6"
|
||||
@ -1273,6 +1266,13 @@
|
||||
dependencies:
|
||||
"@sinclair/typebox" "^0.24.1"
|
||||
|
||||
"@jest/schemas@^29.4.0":
|
||||
version "29.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.0.tgz#0d6ad358f295cc1deca0b643e6b4c86ebd539f17"
|
||||
integrity sha512-0E01f/gOZeNTG76i5eWWSupvSHaIINrTie7vCyjiYFKgzNdyEGd12BUv4oNBFHOqlHDbtoJi3HrQ38KCC90NsQ==
|
||||
dependencies:
|
||||
"@sinclair/typebox" "^0.25.16"
|
||||
|
||||
"@jest/source-map@^29.2.0":
|
||||
version "29.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744"
|
||||
@ -1323,17 +1323,6 @@
|
||||
slash "^3.0.0"
|
||||
write-file-atomic "^4.0.1"
|
||||
|
||||
"@jest/types@^27.5.1":
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80"
|
||||
integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==
|
||||
dependencies:
|
||||
"@types/istanbul-lib-coverage" "^2.0.0"
|
||||
"@types/istanbul-reports" "^3.0.0"
|
||||
"@types/node" "*"
|
||||
"@types/yargs" "^16.0.0"
|
||||
chalk "^4.0.0"
|
||||
|
||||
"@jest/types@^29.3.1":
|
||||
version "29.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3"
|
||||
@ -1346,6 +1335,18 @@
|
||||
"@types/yargs" "^17.0.8"
|
||||
chalk "^4.0.0"
|
||||
|
||||
"@jest/types@^29.4.1":
|
||||
version "29.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.4.1.tgz#f9f83d0916f50696661da72766132729dcb82ecb"
|
||||
integrity sha512-zbrAXDUOnpJ+FMST2rV7QZOgec8rskg2zv8g2ajeqitp4tvZiyqTCYXANrKsM+ryj5o+LI+ZN2EgU9drrkiwSA==
|
||||
dependencies:
|
||||
"@jest/schemas" "^29.4.0"
|
||||
"@types/istanbul-lib-coverage" "^2.0.0"
|
||||
"@types/istanbul-reports" "^3.0.0"
|
||||
"@types/node" "*"
|
||||
"@types/yargs" "^17.0.8"
|
||||
chalk "^4.0.0"
|
||||
|
||||
"@jridgewell/gen-mapping@^0.1.0":
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996"
|
||||
@ -1489,6 +1490,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f"
|
||||
integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==
|
||||
|
||||
"@sinclair/typebox@^0.25.16":
|
||||
version "0.25.21"
|
||||
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272"
|
||||
integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g==
|
||||
|
||||
"@sinonjs/commons@^1.7.0":
|
||||
version "1.8.6"
|
||||
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9"
|
||||
@ -1503,80 +1509,6 @@
|
||||
dependencies:
|
||||
"@sinonjs/commons" "^1.7.0"
|
||||
|
||||
"@swc/core-darwin-arm64@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.26.tgz#43355315f0668a6a5366208f09678349bc0f44ee"
|
||||
integrity sha512-FWWflBfKRYrUJtko2xiedC5XCa31O75IZZqnTWuLpe9g3C5tnUuF3M8LSXZS/dn6wprome1MhtG9GMPkSYkhkg==
|
||||
|
||||
"@swc/core-darwin-x64@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.26.tgz#462fc2e1377437b7c7bbdf5988f51adfeea3efa9"
|
||||
integrity sha512-0uQeebAtsewqJ2b35aPZstGrylwd6oJjUyAJOfVJNbremFSJ5JzytB3NoDCIw7CT5UQrSRpvD3mU95gfdQjDGA==
|
||||
|
||||
"@swc/core-linux-arm-gnueabihf@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.26.tgz#fecd9c2e7d9b69c849907a83a5101a98c047d986"
|
||||
integrity sha512-06T+LbVFlyciQtwrUB5/a16A1ju1jFoYvd/hq9TWhf7GrtL43U7oJIgqMOPHx2j0+Ps2R3S6R/UUN5YXu618zA==
|
||||
|
||||
"@swc/core-linux-arm64-gnu@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.26.tgz#82a8462212263f4e4f6691473d4c2839b73c2084"
|
||||
integrity sha512-2NT/0xALPfK+U01qIlHxjkGdIj6F0txhu1U2v6B0YP2+k0whL2gCgYeg9QUvkYEXSD5r1Yx+vcb2R/vaSCSClg==
|
||||
|
||||
"@swc/core-linux-arm64-musl@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.26.tgz#050b7c1aa81d6f34769eb556c3a94c61a9b69aaa"
|
||||
integrity sha512-64KrTay9hC0mTvZ1AmEFmNEwV5QDjw9U7PJU5riotSc28I+Q/ZoM0qcSFW9JRRa6F2Tr+IfMtyv8+eB2//BQ5g==
|
||||
|
||||
"@swc/core-linux-x64-gnu@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.26.tgz#e306778c2c1838350f588c8ae800e74434dc2b9a"
|
||||
integrity sha512-Te8G13l3dcRM1Mf3J4JzGUngzNXLKnMYlUmBOYN/ORsx7e+VNelR3zsTLHC0+0jGqELDgqvMyzDfk+dux/C/bQ==
|
||||
|
||||
"@swc/core-linux-x64-musl@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.26.tgz#531d9ec7c37f56df5c6cc121db5dd6faff5e2c38"
|
||||
integrity sha512-nqQWuSM6OTKepUiQ9+rXgERq/JiO72RBOpXKO2afYppsL96sngjIRewV74v5f6IAfyzw+k+AhC5pgRA4Xu/Jkg==
|
||||
|
||||
"@swc/core-win32-arm64-msvc@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.26.tgz#9c7f245903694484bd00c4da5142f24070094d0f"
|
||||
integrity sha512-xx34mx+9IBV1sun7sxoNFiqNom9wiOuvsQFJUyQptCnZHgYwOr9OI204LBF95dCcBCZsTm2hT1wBnySJOeimYw==
|
||||
|
||||
"@swc/core-win32-ia32-msvc@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.26.tgz#56d83cc216218d78cc578f01499777cdfc0a4eeb"
|
||||
integrity sha512-48LZ/HKNuU9zl8c7qG6IQKb5rBCwmJgysGOmEGzTRBYxAf/x6Scmt0aqxCoV4J02HOs2WduCBDnhUKsSQ2kcXQ==
|
||||
|
||||
"@swc/core-win32-x64-msvc@1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.26.tgz#bb65bc0fff712c8ca3702d9c0adc59894ca54bae"
|
||||
integrity sha512-UPe7S+MezD/S6cKBIc50TduGzmw6PBz1Ms5p+5wDLOKYNS/LSEM4iRmLwvePzP5X8mOyesXrsbwxLy8KHP65Yw==
|
||||
|
||||
"@swc/core@^1.3.26":
|
||||
version "1.3.26"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.26.tgz#6f7fe6ad54eac7ecffbdfa75d5c4300e2f96b8f6"
|
||||
integrity sha512-U7vEsaLn3IGg0XCRLJX/GTkK9WIfFHUX5USdrp1L2QD29sWPe25HqNndXmUR9KytzKmpDMNoUuHyiuhpVrnNeQ==
|
||||
optionalDependencies:
|
||||
"@swc/core-darwin-arm64" "1.3.26"
|
||||
"@swc/core-darwin-x64" "1.3.26"
|
||||
"@swc/core-linux-arm-gnueabihf" "1.3.26"
|
||||
"@swc/core-linux-arm64-gnu" "1.3.26"
|
||||
"@swc/core-linux-arm64-musl" "1.3.26"
|
||||
"@swc/core-linux-x64-gnu" "1.3.26"
|
||||
"@swc/core-linux-x64-musl" "1.3.26"
|
||||
"@swc/core-win32-arm64-msvc" "1.3.26"
|
||||
"@swc/core-win32-ia32-msvc" "1.3.26"
|
||||
"@swc/core-win32-x64-msvc" "1.3.26"
|
||||
|
||||
"@swc/jest@^0.2.24":
|
||||
version "0.2.24"
|
||||
resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.24.tgz#35d9377ede049613cd5fdd6c24af2b8dcf622875"
|
||||
integrity sha512-fwgxQbM1wXzyKzl1+IW0aGrRvAA8k0Y3NxFhKigbPjOJ4mCKnWEcNX9HQS3gshflcxq8YKhadabGUVfdwjCr6Q==
|
||||
dependencies:
|
||||
"@jest/create-cache-key-function" "^27.4.2"
|
||||
jsonc-parser "^3.2.0"
|
||||
|
||||
"@testing-library/dom@^8.5.0":
|
||||
version "8.19.1"
|
||||
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.19.1.tgz#0e2dafd281dedb930bb235eac1045470b4129d0e"
|
||||
@ -1674,14 +1606,6 @@
|
||||
dependencies:
|
||||
"@types/istanbul-lib-report" "*"
|
||||
|
||||
"@types/jest@^29.2.5":
|
||||
version "29.2.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.5.tgz#c27f41a9d6253f288d1910d3c5f09484a56b73c0"
|
||||
integrity sha512-H2cSxkKgVmqNHXP7TC2L/WUorrZu8ZigyRywfVzv6EyBlxj39n4C00hjXYQWsbwqgElaj/CiAeSRmk5GoaKTgw==
|
||||
dependencies:
|
||||
expect "^29.0.0"
|
||||
pretty-format "^29.0.0"
|
||||
|
||||
"@types/jsdom@^20.0.0":
|
||||
version "20.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808"
|
||||
@ -1767,13 +1691,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b"
|
||||
integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==
|
||||
|
||||
"@types/yargs@^16.0.0":
|
||||
version "16.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.5.tgz#12cc86393985735a283e387936398c2f9e5f88e3"
|
||||
integrity sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==
|
||||
dependencies:
|
||||
"@types/yargs-parser" "*"
|
||||
|
||||
"@types/yargs@^17.0.8":
|
||||
version "17.0.19"
|
||||
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.19.tgz#8dbecdc9ab48bee0cb74f6e3327de3fa0d0c98ae"
|
||||
@ -2138,6 +2055,13 @@ browserslist@^4.21.3, browserslist@^4.21.4:
|
||||
node-releases "^2.0.6"
|
||||
update-browserslist-db "^1.0.9"
|
||||
|
||||
bs-logger@0.x:
|
||||
version "0.2.6"
|
||||
resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8"
|
||||
integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==
|
||||
dependencies:
|
||||
fast-json-stable-stringify "2.x"
|
||||
|
||||
bser@2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05"
|
||||
@ -2347,10 +2271,10 @@ data-urls@^3.0.2:
|
||||
whatwg-mimetype "^3.0.0"
|
||||
whatwg-url "^11.0.0"
|
||||
|
||||
date-fns@2.27.0, date-fns@^2.29.1:
|
||||
version "2.27.0"
|
||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.27.0.tgz#e1ff3c3ddbbab8a2eaadbb6106be2929a5a2d92b"
|
||||
integrity sha512-sj+J0Mo2p2X1e306MHq282WS4/A8Pz/95GIFcsPNMPMZVI3EUrAdSv90al1k+p74WGLCruMXk23bfEDZa71X9Q==
|
||||
date-fns@^2.29.1:
|
||||
version "2.29.3"
|
||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8"
|
||||
integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==
|
||||
|
||||
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4:
|
||||
version "4.3.4"
|
||||
@ -2878,7 +2802,7 @@ exit@^0.1.2:
|
||||
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
|
||||
integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==
|
||||
|
||||
expect@^29.0.0, expect@^29.3.1:
|
||||
expect@^29.3.1:
|
||||
version "29.3.1"
|
||||
resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6"
|
||||
integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA==
|
||||
@ -2910,7 +2834,7 @@ fast-glob@^3.2.9:
|
||||
merge2 "^1.3.0"
|
||||
micromatch "^4.0.4"
|
||||
|
||||
fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
|
||||
fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
|
||||
@ -3845,6 +3769,18 @@ jest-snapshot@^29.3.1:
|
||||
pretty-format "^29.3.1"
|
||||
semver "^7.3.5"
|
||||
|
||||
jest-util@^29.0.0:
|
||||
version "29.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.4.1.tgz#2eeed98ff4563b441b5a656ed1a786e3abc3e4c4"
|
||||
integrity sha512-bQy9FPGxVutgpN4VRc0hk6w7Hx/m6L53QxpDreTZgJd9gfx/AV2MjyPde9tGyZRINAUrSv57p2inGBu2dRLmkQ==
|
||||
dependencies:
|
||||
"@jest/types" "^29.4.1"
|
||||
"@types/node" "*"
|
||||
chalk "^4.0.0"
|
||||
ci-info "^3.2.0"
|
||||
graceful-fs "^4.2.9"
|
||||
picomatch "^2.2.3"
|
||||
|
||||
jest-util@^29.3.1:
|
||||
version "29.3.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1"
|
||||
@ -3997,7 +3933,7 @@ json5@^1.0.1:
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
|
||||
json5@^2.2.2:
|
||||
json5@^2.2.2, json5@^2.2.3:
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
|
||||
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
|
||||
@ -4070,6 +4006,11 @@ lodash.debounce@^4.0.8:
|
||||
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
|
||||
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
|
||||
|
||||
lodash.memoize@4.x:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
|
||||
integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==
|
||||
|
||||
lodash.merge@^4.6.2:
|
||||
version "4.6.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
|
||||
@ -4120,6 +4061,11 @@ make-dir@^3.0.0:
|
||||
dependencies:
|
||||
semver "^6.0.0"
|
||||
|
||||
make-error@1.x:
|
||||
version "1.3.6"
|
||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
||||
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
|
||||
|
||||
makeerror@1.0.12:
|
||||
version "1.0.12"
|
||||
resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a"
|
||||
@ -4462,7 +4408,7 @@ pretty-format@^27.0.2:
|
||||
ansi-styles "^5.0.0"
|
||||
react-is "^17.0.1"
|
||||
|
||||
pretty-format@^29.0.0, pretty-format@^29.3.1:
|
||||
pretty-format@^29.3.1:
|
||||
version "29.3.1"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da"
|
||||
integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==
|
||||
@ -4748,18 +4694,18 @@ scheduler@^0.23.0:
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
|
||||
semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
|
||||
version "6.3.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||
|
||||
semver@^7.3.2, semver@^7.3.5, semver@^7.3.7:
|
||||
semver@7.x, semver@^7.3.2, semver@^7.3.5, semver@^7.3.7:
|
||||
version "7.3.8"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
|
||||
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
|
||||
version "6.3.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||
|
||||
serialize-javascript@^6.0.0:
|
||||
version "6.0.0"
|
||||
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8"
|
||||
@ -5050,6 +4996,20 @@ tree-kill@^1.2.2:
|
||||
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
|
||||
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
|
||||
|
||||
ts-jest@^29.0.5:
|
||||
version "29.0.5"
|
||||
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.0.5.tgz#c5557dcec8fe434fcb8b70c3e21c6b143bfce066"
|
||||
integrity sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==
|
||||
dependencies:
|
||||
bs-logger "0.x"
|
||||
fast-json-stable-stringify "2.x"
|
||||
jest-util "^29.0.0"
|
||||
json5 "^2.2.3"
|
||||
lodash.memoize "4.x"
|
||||
make-error "1.x"
|
||||
semver "7.x"
|
||||
yargs-parser "^21.0.1"
|
||||
|
||||
tsconfig-paths@^3.14.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a"
|
||||
@ -5336,7 +5296,7 @@ yallist@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
||||
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
|
||||
|
||||
yargs-parser@^21.1.1:
|
||||
yargs-parser@^21.0.1, yargs-parser@^21.1.1:
|
||||
version "21.1.1"
|
||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
|
||||
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user