From 49fcc3c6ac09c4a05637f85279e2b4462a175b00 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 20 Dec 2022 18:58:11 +0100 Subject: [PATCH 1/3] make tests use SWC, not babel --- code/jest.config.base.js | 16 +----------- .../transforms/__tests__/csf-2-to-3.test.ts | 2 +- .../lib/manager-api/src/tests/stories.test.ts | 8 +++--- .../PreviewWeb.integration.test.ts | 1 - .../modules/preview-web/PreviewWeb.test.ts | 8 ++---- .../render/StandaloneDocsRender.test.ts | 1 - .../preview-web/render/StoryRender.test.ts | 1 - .../render/TemplateDocsRender.test.ts | 1 - code/package.json | 2 +- code/yarn.lock | 25 +++++++++++++++++-- scripts/package.json | 1 - scripts/utils/jest-transform-js.js | 6 ----- scripts/utils/jest-transform-ts.js | 10 -------- scripts/yarn.lock | 1 - 14 files changed, 31 insertions(+), 52 deletions(-) delete mode 100644 scripts/utils/jest-transform-js.js delete mode 100644 scripts/utils/jest-transform-ts.js diff --git a/code/jest.config.base.js b/code/jest.config.base.js index dd8850d0115c..c24f2699d32d 100644 --- a/code/jest.config.base.js +++ b/code/jest.config.base.js @@ -24,23 +24,9 @@ module.exports = { path.resolve('./__mocks__/fileMock.js'), '\\.(css|scss|stylesheet)$': path.resolve('./__mocks__/styleMock.js'), '\\.(md)$': path.resolve('./__mocks__/htmlMock.js'), - - // core-js v2 to v3 mapping - 'core-js/modules/es6.(.*)': 'core-js/modules/es.$1', - 'core-js/modules/es7.(.*)': 'core-js/modules/esnext.$1', - 'core-js/library/fn/(.*)': `core-js/features/$1`, - 'core-js/es5/(.*)': `core-js/es/$1`, - 'core-js/es6/(.*)': `core-js/es/$1`, - 'core-js/es7/reflect': `core-js/proposals/reflect-metadata`, - 'core-js/es7/(.*)': `core-js/proposals/$1`, - 'core-js/object$/': `core-js/es/object`, - 'core-js/object/(.*)': `core-js/es/object/$1`, - 'babel-runtime/core-js/(.*)': `core-js/es/$1`, - // 'babel-runtime/core-js/object/assign' - 'core-js/library/fn/object/assign': 'core-js/es/object/assign', }, transform: { - '^.+\\.[jt]sx?$': path.resolve('../scripts/utils/jest-transform-js.js'), + '^.+\\.(t|j)sx?$': ['@swc/jest'], '^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx', }, transformIgnorePatterns: ['/node_modules/(?!@angular|rxjs|nanoid|uuid|lit-html|@mdx-js)'], diff --git a/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts b/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts index 3bf91f5b830b..1df59763c64b 100644 --- a/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts +++ b/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts @@ -1,4 +1,4 @@ -import { describe, it, expect } from '@jest/globals'; +// import { describe, it, expect } from '@jest/globals'; import { dedent } from 'ts-dedent'; import _transform from '../csf-2-to-3'; diff --git a/code/lib/manager-api/src/tests/stories.test.ts b/code/lib/manager-api/src/tests/stories.test.ts index 072527e8eb50..8c9f025c4635 100644 --- a/code/lib/manager-api/src/tests/stories.test.ts +++ b/code/lib/manager-api/src/tests/stories.test.ts @@ -1,6 +1,4 @@ /// ; -// Need to import jest as mockJest for annoying jest reasons. Is there a better way? -import { jest, jest as mockJest, it, describe, expect, beforeEach } from '@jest/globals'; import { STORY_ARGS_UPDATED, @@ -34,12 +32,12 @@ function mockChannel() { return new Channel({ transport }); } -const mockGetEntries = jest.fn<() => StoryIndex['entries']>(); +const mockGetEntries = jest.fn(); jest.mock('../lib/events'); jest.mock('global', () => ({ - ...(mockJest.requireActual('global') as Record), - fetch: mockJest.fn(() => ({ json: () => ({ v: 4, entries: mockGetEntries() }) })), + ...(jest.requireActual('global') as Record), + fetch: jest.fn(() => ({ json: () => ({ v: 4, entries: mockGetEntries() }) })), FEATURES: { storyStoreV7: true }, CONFIG_TYPE: 'DEVELOPMENT', })); diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts index a6bebfec9ea5..93871426c029 100644 --- a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts @@ -5,7 +5,6 @@ import React from 'react'; import global from 'global'; import type { RenderContext } from '@storybook/types'; -import { expect } from '@jest/globals'; import { addons, mockChannel as createMockChannel } from '../addons'; import { PreviewWeb } from './PreviewWeb'; diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts index 79e9769c728d..d7d5477b0333 100644 --- a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts @@ -2,7 +2,6 @@ * @jest-environment jsdom */ -import { jest, jest as mockJest, it, describe, beforeEach, afterEach, expect } from '@jest/globals'; import global from 'global'; import merge from 'lodash/merge'; import { @@ -60,8 +59,8 @@ const mockStoryIndex = jest.fn(() => storyIndex); let mockFetchResult: any; jest.mock('global', () => ({ - ...(mockJest.requireActual('global') as any), - history: { replaceState: mockJest.fn() }, + ...(jest.requireActual('global') as any), + history: { replaceState: jest.fn() }, document: { location: { pathname: 'pathname', @@ -97,7 +96,6 @@ const createGate = (): [Promise, (_?: any) => void] => { // a timer, so we need to first setImmediate (to get past the resolution), then run the timers // Probably jest modern timers do this but they aren't working for some bizarre reason. async function waitForSetCurrentStory() { - // @ts-expect-error (Argument of type '{ doNotFake: string[]; }' is not assignable to parameter of type '"modern" | "legacy" | undefined'. ts(2345))) jest.useFakeTimers({ doNotFake: ['setTimeout'] }); await new Promise((r) => setTimeout(r, 0)); jest.runAllTimers(); @@ -138,9 +136,7 @@ beforeEach(() => { addons.setServerChannel(createMockChannel()); mockFetchResult = { status: 200, json: mockStoryIndex, text: () => 'error text' }; - // @ts-expect-error (Property 'mocked' does not exist on type 'Jest'. Did you mean 'mock'? ts(2551)) jest.mocked(WebView.prototype).prepareForDocs.mockReturnValue('docs-element' as any); - // @ts-expect-error (Property 'mocked' does not exist on type 'Jest'. Did you mean 'mock'? ts(2551)) jest.mocked(WebView.prototype).prepareForStory.mockReturnValue('story-element' as any); }); diff --git a/code/lib/preview-api/src/modules/preview-web/render/StandaloneDocsRender.test.ts b/code/lib/preview-api/src/modules/preview-web/render/StandaloneDocsRender.test.ts index d93f1918a32a..a5bf147acfe6 100644 --- a/code/lib/preview-api/src/modules/preview-web/render/StandaloneDocsRender.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/render/StandaloneDocsRender.test.ts @@ -1,4 +1,3 @@ -import { jest, describe, it, expect } from '@jest/globals'; import { Channel } from '@storybook/channels'; import type { Renderer, StandaloneDocsIndexEntry } from '@storybook/types'; import type { StoryStore } from '../../store'; diff --git a/code/lib/preview-api/src/modules/preview-web/render/StoryRender.test.ts b/code/lib/preview-api/src/modules/preview-web/render/StoryRender.test.ts index 7cebb7ca1e2b..d40adca995f0 100644 --- a/code/lib/preview-api/src/modules/preview-web/render/StoryRender.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/render/StoryRender.test.ts @@ -1,4 +1,3 @@ -import { jest, describe, it, expect } from '@jest/globals'; import { Channel } from '@storybook/channels'; import type { Renderer, StoryIndexEntry } from '@storybook/types'; import type { StoryStore } from '../../store'; diff --git a/code/lib/preview-api/src/modules/preview-web/render/TemplateDocsRender.test.ts b/code/lib/preview-api/src/modules/preview-web/render/TemplateDocsRender.test.ts index 1ed78212c3f2..895f954abfa7 100644 --- a/code/lib/preview-api/src/modules/preview-web/render/TemplateDocsRender.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/render/TemplateDocsRender.test.ts @@ -1,4 +1,3 @@ -import { jest, describe, it, expect } from '@jest/globals'; import { Channel } from '@storybook/channels'; import type { Renderer, TemplateDocsIndexEntry } from '@storybook/types'; import type { StoryStore } from '../../store'; diff --git a/code/package.json b/code/package.json index 37274df05ec5..4e71818ad424 100644 --- a/code/package.json +++ b/code/package.json @@ -221,6 +221,7 @@ "@storybook/web-components-vite": "workspace:*", "@storybook/web-components-webpack5": "workspace:*", "@swc/core": "^1.3.23", + "@swc/jest": "^0.2.24", "@testing-library/dom": "^7.29.4", "@testing-library/jest-dom": "^5.11.9", "@testing-library/react": "^11.2.2", @@ -246,7 +247,6 @@ "@vitejs/plugin-react": "^2.1.0", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "^10.1.0", - "babel-jest": "^29.3.1", "babel-loader": "^8.3.0", "chromatic": "6.11.2", "codecov": "^3.8.1", diff --git a/code/yarn.lock b/code/yarn.lock index ab82c3771251..009f8ab7c4ee 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -3016,6 +3016,15 @@ __metadata: languageName: node linkType: hard +"@jest/create-cache-key-function@npm:^27.4.2": + version: 27.5.1 + resolution: "@jest/create-cache-key-function@npm:27.5.1" + dependencies: + "@jest/types": ^27.5.1 + checksum: 1890ac93fad852e0a98c31de1e5f2c548974aefd36e838d27b70834dda1654a153ed6a52258447ebacfd47463e9bdb83750631bee827797c7b9973c083998a96 + languageName: node + linkType: hard + "@jest/environment@npm:^26.6.2": version: 26.6.2 resolution: "@jest/environment@npm:26.6.2" @@ -7221,6 +7230,7 @@ __metadata: "@storybook/web-components-vite": "workspace:*" "@storybook/web-components-webpack5": "workspace:*" "@swc/core": ^1.3.23 + "@swc/jest": ^0.2.24 "@testing-library/dom": ^7.29.4 "@testing-library/jest-dom": ^5.11.9 "@testing-library/react": ^11.2.2 @@ -7246,7 +7256,6 @@ __metadata: "@vitejs/plugin-react": ^2.1.0 babel-core: ^7.0.0-bridge.0 babel-eslint: ^10.1.0 - babel-jest: ^29.3.1 babel-loader: ^8.3.0 chromatic: 6.11.2 codecov: ^3.8.1 @@ -7947,6 +7956,18 @@ __metadata: languageName: node linkType: hard +"@swc/jest@npm:^0.2.24": + version: 0.2.24 + resolution: "@swc/jest@npm:0.2.24" + dependencies: + "@jest/create-cache-key-function": ^27.4.2 + jsonc-parser: ^3.2.0 + peerDependencies: + "@swc/core": "*" + checksum: 62d9bfe8895e003b7dc360c19106b8eca72d9e9ea4769bc7b60de76cb6e398274fdd383cec9fc9344ca8cb76b18e8063c7182997da2c1d057b8a127c542e6b8f + languageName: node + linkType: hard + "@testing-library/dom@npm:^7.28.1, @testing-library/dom@npm:^7.29.4": version: 7.31.2 resolution: "@testing-library/dom@npm:7.31.2" @@ -21594,7 +21615,7 @@ __metadata: languageName: node linkType: hard -"jsonc-parser@npm:^3.0.0": +"jsonc-parser@npm:^3.0.0, jsonc-parser@npm:^3.2.0": version: 3.2.0 resolution: "jsonc-parser@npm:3.2.0" checksum: 5a12d4d04dad381852476872a29dcee03a57439574e4181d91dca71904fcdcc5e8e4706c0a68a2c61ad9810e1e1c5806b5100d52d3e727b78f5cdc595401045b diff --git a/scripts/package.json b/scripts/package.json index 4aab7d77ce73..d960b5937c5e 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -78,7 +78,6 @@ "@typescript-eslint/experimental-utils": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", "babel-eslint": "^10.1.0", - "babel-jest": "^29.3.1", "babel-loader": "^8.3.0", "boxen": "^5.1.2", "chalk": "^4.1.0", diff --git a/scripts/utils/jest-transform-js.js b/scripts/utils/jest-transform-js.js deleted file mode 100644 index beb458216df9..000000000000 --- a/scripts/utils/jest-transform-js.js +++ /dev/null @@ -1,6 +0,0 @@ -const path = require('path'); -const babelJest = require('babel-jest'); - -module.exports = babelJest.createTransformer({ - configFile: path.resolve(__dirname, '..', '.babelrc'), -}); diff --git a/scripts/utils/jest-transform-ts.js b/scripts/utils/jest-transform-ts.js deleted file mode 100644 index 9fbd7c766509..000000000000 --- a/scripts/utils/jest-transform-ts.js +++ /dev/null @@ -1,10 +0,0 @@ -const tsTransformer = require('jest-preset-angular/preprocessor'); -const babelTransformer = require('./jest-transform-js'); - -module.exports.process = function transform(src, path, config, transformOptions) { - const tsResult = tsTransformer.process(src, path, config, transformOptions); - const jsPath = path.replace('.ts', '.js'); - const source = typeof tsResult === 'string' ? tsResult : tsResult.code; - - return babelTransformer.process(source, jsPath, config, transformOptions); -}; diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 57771574b7e0..69f85e420f4a 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -3184,7 +3184,6 @@ __metadata: "@typescript-eslint/experimental-utils": ^5.45.0 "@typescript-eslint/parser": ^5.45.0 babel-eslint: ^10.1.0 - babel-jest: ^29.3.1 babel-loader: ^8.3.0 boxen: ^5.1.2 chalk: ^4.1.0 From ea513721f157f4356986b00fdb7e0f1fd4409849 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 20 Dec 2022 22:50:53 +0100 Subject: [PATCH 2/3] dep changes --- code/addons/interactions/package.json | 4 +- code/package.json | 4 +- code/yarn.lock | 304 +++++++++----------------- scripts/package.json | 2 +- scripts/yarn.lock | 185 +++++++++++++++- 5 files changed, 287 insertions(+), 212 deletions(-) diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index de57e5f5d38c..e281fcc71b4f 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -88,8 +88,8 @@ }, "devDependencies": { "@devtools-ds/object-inspector": "^1.1.2", - "@storybook/jest": "^0.0.10", - "@storybook/testing-library": "0.0.14-next.0", + "@storybook/jest": "next", + "@storybook/testing-library": "next", "@types/node": "^16.0.0", "formik": "^2.2.9", "typescript": "~4.9.3" diff --git a/code/package.json b/code/package.json index 4e71818ad424..f64af2be8ac6 100644 --- a/code/package.json +++ b/code/package.json @@ -178,7 +178,7 @@ "@storybook/html-vite": "workspace:*", "@storybook/html-webpack5": "workspace:*", "@storybook/instrumenter": "workspace:*", - "@storybook/jest": "^0.0.10", + "@storybook/jest": "next", "@storybook/linter-config": "^2.5.0", "@storybook/manager": "workspace:*", "@storybook/manager-api": "workspace:*", @@ -209,7 +209,7 @@ "@storybook/svelte": "workspace:*", "@storybook/svelte-webpack5": "workspace:*", "@storybook/telemetry": "workspace:*", - "@storybook/testing-library": "0.0.14-next.0", + "@storybook/testing-library": "next", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", "@storybook/vue": "workspace:*", diff --git a/code/yarn.lock b/code/yarn.lock index 009f8ab7c4ee..ea1ea9bb3def 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5414,10 +5414,10 @@ __metadata: "@storybook/core-common": 7.0.0-beta.12 "@storybook/core-events": 7.0.0-beta.12 "@storybook/instrumenter": 7.0.0-beta.12 - "@storybook/jest": ^0.0.10 + "@storybook/jest": next "@storybook/manager-api": 7.0.0-beta.12 "@storybook/preview-api": 7.0.0-beta.12 - "@storybook/testing-library": 0.0.14-next.0 + "@storybook/testing-library": next "@storybook/theming": 7.0.0-beta.12 "@storybook/types": 7.0.0-beta.12 "@types/node": ^16.0.0 @@ -5734,28 +5734,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addons@npm:6.5.14": - version: 6.5.14 - resolution: "@storybook/addons@npm:6.5.14" - dependencies: - "@storybook/api": 6.5.14 - "@storybook/channels": 6.5.14 - "@storybook/client-logger": 6.5.14 - "@storybook/core-events": 6.5.14 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/router": 6.5.14 - "@storybook/theming": 6.5.14 - "@types/webpack-env": ^1.16.0 - core-js: ^3.8.2 - global: ^4.4.0 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: bc4dc3e40252e38d411e59c31bab1de2e298c3b133aabacb47ed8400cae45d0bd77a9987d3c80fdaed565ff3dcfd4df8b47aeb80632fb8d6fbe2a4db782c55f2 - languageName: node - linkType: hard - "@storybook/angular@7.0.0-beta.12, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": version: 0.0.0-use.local resolution: "@storybook/angular@workspace:frameworks/angular" @@ -5845,34 +5823,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/api@npm:6.5.14": - version: 6.5.14 - resolution: "@storybook/api@npm:6.5.14" - dependencies: - "@storybook/channels": 6.5.14 - "@storybook/client-logger": 6.5.14 - "@storybook/core-events": 6.5.14 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/router": 6.5.14 - "@storybook/semver": ^7.3.2 - "@storybook/theming": 6.5.14 - core-js: ^3.8.2 - fast-deep-equal: ^3.1.3 - global: ^4.4.0 - lodash: ^4.17.21 - memoizerific: ^1.11.3 - regenerator-runtime: ^0.13.7 - store2: ^2.12.0 - telejson: ^6.0.8 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 38ff67de3ac82ce7dca76c3f5f5dab8f788b935cbd3b65ec7a733509257d7383ebc5988e8e25097b66ad60218dede9165c8963402421a6daa2d5612a14515377 - languageName: node - linkType: hard - "@storybook/babel-plugin-require-context-hook@npm:1.0.1": version: 1.0.1 resolution: "@storybook/babel-plugin-require-context-hook@npm:1.0.1" @@ -6054,6 +6004,20 @@ __metadata: languageName: unknown linkType: soft +"@storybook/channel-postmessage@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/channel-postmessage@npm:7.0.0-beta.13" + dependencies: + "@storybook/channels": 7.0.0-beta.13 + "@storybook/client-logger": 7.0.0-beta.13 + "@storybook/core-events": 7.0.0-beta.13 + "@storybook/global": ^5.0.0 + qs: ^6.10.0 + telejson: ^7.0.3 + checksum: ceff9b76a59b93aceef9b36cadc935ec78f7a6686185da9cc19f3d58595ec43b8fa989772f1cdc1244094773311aeefe96fabc085d64d8c45b93d4a1ef5f9ce7 + languageName: node + linkType: hard + "@storybook/channel-websocket@7.0.0-beta.12, @storybook/channel-websocket@workspace:*, @storybook/channel-websocket@workspace:lib/channel-websocket": version: 0.0.0-use.local resolution: "@storybook/channel-websocket@workspace:lib/channel-websocket" @@ -6074,14 +6038,10 @@ __metadata: languageName: unknown linkType: soft -"@storybook/channels@npm:6.5.14": - version: 6.5.14 - resolution: "@storybook/channels@npm:6.5.14" - dependencies: - core-js: ^3.8.2 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - checksum: c047318f7f2b08e60e4f0fde5b68f88214c2ef070d32fd3fc8ea9734c7deefd6e83c5b274a1176f2fda6523b1e9ce7bcac632559fb20bb14c58d2099d664353d +"@storybook/channels@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/channels@npm:7.0.0-beta.13" + checksum: 97a5b95160b8f4f3addae0f7e32173f443465b3972f570525ff49016afb424089fc53b6775618e8d637203981f7efd11646c3552ab1fbf8966a7c14f49fc6260 languageName: node linkType: hard @@ -6154,13 +6114,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-logger@npm:6.5.14, @storybook/client-logger@npm:^6.4.0": - version: 6.5.14 - resolution: "@storybook/client-logger@npm:6.5.14" +"@storybook/client-logger@npm:7.0.0-beta.13, @storybook/client-logger@npm:next": + version: 7.0.0-beta.13 + resolution: "@storybook/client-logger@npm:7.0.0-beta.13" dependencies: - core-js: ^3.8.2 - global: ^4.4.0 - checksum: 5e12f1fcdc5547236324fcd86d5009827f033ae37ad3006ad269a285fd9a9ba904420ce71f382b5c46ae65d7125d9b7ed1201123e243a0395245aec17a049330 + "@storybook/global": ^5.0.0 + checksum: 7707d6cda7494336b494bfe92c7a43e0c5566f66606545b635613c17898422bc548502ca53c8d0f3aea6bcdb62a30e0179848c2bde588e0e90e2a3f55771d684 languageName: node linkType: hard @@ -6270,12 +6229,10 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-events@npm:6.5.14": - version: 6.5.14 - resolution: "@storybook/core-events@npm:6.5.14" - dependencies: - core-js: ^3.8.2 - checksum: 497e60a6063ce5ffa35781dafc28d57a63b0d8dda6f91d2ee20b2d1729450cabbd6e6e945c5ef104cbf7710577214f4decc7388cd348fb556c1cc19a143d9b77 +"@storybook/core-events@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/core-events@npm:7.0.0-beta.13" + checksum: d186f5be6e761ae5e1c82a422fc2a6d39baca8be8e5acf7a65974935e33acdc3891e9f814f8d71031caaee12ba059f24d074f9725af684e8af07acfa105fcd43 languageName: node linkType: hard @@ -6378,15 +6335,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/csf@npm:0.0.2--canary.4566f4d.1": - version: 0.0.2--canary.4566f4d.1 - resolution: "@storybook/csf@npm:0.0.2--canary.4566f4d.1" - dependencies: - lodash: ^4.17.15 - checksum: dc0fe9940a47fbba9762275083816953da07a188f0315a631c307716b16a7073586a4d229df6b177dfb4b01604667e2bb24c13d6bfcb137d2f4d306874a590f4 - languageName: node - linkType: hard - "@storybook/csf@npm:^0.0.1": version: 0.0.1 resolution: "@storybook/csf@npm:0.0.1" @@ -6473,6 +6421,13 @@ __metadata: languageName: node linkType: hard +"@storybook/global@npm:^5.0.0": + version: 5.0.0 + resolution: "@storybook/global@npm:5.0.0" + checksum: 8f1b61dcdd3a89584540896e659af2ecc700bc740c16909a7be24ac19127ea213324de144a141f7caf8affaed017d064fea0618d453afbe027cf60f54b4a6d0b + languageName: node + linkType: hard + "@storybook/html-vite@workspace:*, @storybook/html-vite@workspace:frameworks/html-vite": version: 0.0.0-use.local resolution: "@storybook/html-vite@workspace:frameworks/html-vite" @@ -6540,28 +6495,29 @@ __metadata: languageName: unknown linkType: soft -"@storybook/instrumenter@npm:^6.4.0": - version: 6.5.14 - resolution: "@storybook/instrumenter@npm:6.5.14" +"@storybook/instrumenter@npm:next": + version: 7.0.0-beta.13 + resolution: "@storybook/instrumenter@npm:7.0.0-beta.13" dependencies: - "@storybook/addons": 6.5.14 - "@storybook/client-logger": 6.5.14 - "@storybook/core-events": 6.5.14 + "@storybook/channels": 7.0.0-beta.13 + "@storybook/client-logger": 7.0.0-beta.13 + "@storybook/core-events": 7.0.0-beta.13 + "@storybook/global": ^5.0.0 + "@storybook/preview-api": 7.0.0-beta.13 core-js: ^3.8.2 - global: ^4.4.0 - checksum: b0f49d2a0c24ab959d75cffe5d9a18a4ee1b77f25b6452c6557c55a832fb80698c12da9f76148527b5705bf1136350fa16cd8964f287bc87316e47e27e0ccd50 + checksum: aeefe99fa9bc2fe9f1cfa848a9f09e3888e38d2fba35cee02bc64ebaa31a080b70477d021b9a9b7b5cefa3c01b44ad93ef5d89715ebdea4428fe02845c6378b7 languageName: node linkType: hard -"@storybook/jest@npm:^0.0.10": - version: 0.0.10 - resolution: "@storybook/jest@npm:0.0.10" +"@storybook/jest@npm:next": + version: 0.0.11-next.0 + resolution: "@storybook/jest@npm:0.0.11-next.0" dependencies: "@storybook/expect": storybook-jest - "@storybook/instrumenter": ^6.4.0 + "@storybook/instrumenter": next "@testing-library/jest-dom": ^5.16.2 jest-mock: ^27.3.0 - checksum: f27be53e528adc39718654d6144328ff853bae22fd183a20ed03262ed39ce89fc57715dab91bad62ae663c36899bbb4d9dd2fbc9d5249f1f7cde52b11172e672 + checksum: 36699b8ce63b2cd288f2c5af1bbea1773513da5bb97e05c58ed2194de0a4d7dffaeb699057701e51fab21fb09d5f79635565c182c082233efa8fa1e0bfa16253 languageName: node linkType: hard @@ -6999,6 +6955,30 @@ __metadata: languageName: unknown linkType: soft +"@storybook/preview-api@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/preview-api@npm:7.0.0-beta.13" + dependencies: + "@storybook/channel-postmessage": 7.0.0-beta.13 + "@storybook/channels": 7.0.0-beta.13 + "@storybook/client-logger": 7.0.0-beta.13 + "@storybook/core-events": 7.0.0-beta.13 + "@storybook/csf": next + "@storybook/global": ^5.0.0 + "@storybook/types": 7.0.0-beta.13 + "@types/qs": ^6.9.5 + dequal: ^2.0.2 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + qs: ^6.10.0 + slash: ^3.0.0 + synchronous-promise: ^2.0.15 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + checksum: faa4cce65d03b21ce7802838fa7e000ab28ab2674e0d82185c58c54ad1d79eff00a5d1ac059d5a0aab50af205e83b0f43bcd53538ae5f8285fbe0ff2a0a301c5 + languageName: node + linkType: hard + "@storybook/preview-web@7.0.0-beta.12, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:lib/preview-web": version: 0.0.0-use.local resolution: "@storybook/preview-web@workspace:lib/preview-web" @@ -7187,7 +7167,7 @@ __metadata: "@storybook/html-vite": "workspace:*" "@storybook/html-webpack5": "workspace:*" "@storybook/instrumenter": "workspace:*" - "@storybook/jest": ^0.0.10 + "@storybook/jest": next "@storybook/linter-config": ^2.5.0 "@storybook/manager": "workspace:*" "@storybook/manager-api": "workspace:*" @@ -7218,7 +7198,7 @@ __metadata: "@storybook/svelte": "workspace:*" "@storybook/svelte-webpack5": "workspace:*" "@storybook/telemetry": "workspace:*" - "@storybook/testing-library": 0.0.14-next.0 + "@storybook/testing-library": next "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" "@storybook/vue": "workspace:*" @@ -7373,34 +7353,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/router@npm:6.5.14": - version: 6.5.14 - resolution: "@storybook/router@npm:6.5.14" - dependencies: - "@storybook/client-logger": 6.5.14 - core-js: ^3.8.2 - memoizerific: ^1.11.3 - qs: ^6.10.0 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: bb390cc8d274be2c40cfc5be0c8bfbe67c170f000cfcf6f6498770dd33bd3a9246a0ad852143192c0ca90d484af52cfcc41c69435cd8f7cdb2866d944437ee6b - languageName: node - linkType: hard - -"@storybook/semver@npm:^7.3.2": - version: 7.3.2 - resolution: "@storybook/semver@npm:7.3.2" - dependencies: - core-js: ^3.6.5 - find-up: ^4.1.0 - bin: - semver: bin/semver.js - checksum: f90e0c714d694330e9664af96ff7c3806c10981d6754e839caf59cd6791bf38c050caf98b19e97f7b059fd8521217f5f70b941a79b68a40b485e054d46343791 - languageName: node - linkType: hard - "@storybook/server-webpack5@workspace:*, @storybook/server-webpack5@workspace:frameworks/server-webpack5": version: 0.0.0-use.local resolution: "@storybook/server-webpack5@workspace:frameworks/server-webpack5" @@ -7552,16 +7504,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/testing-library@npm:0.0.14-next.0": - version: 0.0.14-next.0 - resolution: "@storybook/testing-library@npm:0.0.14-next.0" +"@storybook/testing-library@npm:next": + version: 0.0.14-next.1 + resolution: "@storybook/testing-library@npm:0.0.14-next.1" dependencies: - "@storybook/client-logger": ^6.4.0 - "@storybook/instrumenter": ^6.4.0 + "@storybook/client-logger": next + "@storybook/instrumenter": next "@testing-library/dom": ^8.3.0 "@testing-library/user-event": ^13.2.1 ts-dedent: ^2.2.0 - checksum: fd10ebddd305743f4388ad939b90fed155b6c3a755e96a73f72d38d9afe2546a22be0c9a5d83b8b6d91742dd7be5d2e7dfcbbd630b2fa97e4ef7dde00f0824b0 + checksum: 0d386dd136c5f6a5e695247eb7c7fa10182cb73150aae9744d6b7197c6cd049dfeffbbe192c06131858a346726b80e6fa28e8ac7a0f0012759f6f092b219cd61 languageName: node linkType: hard @@ -7590,21 +7542,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/theming@npm:6.5.14": - version: 6.5.14 - resolution: "@storybook/theming@npm:6.5.14" - dependencies: - "@storybook/client-logger": 6.5.14 - core-js: ^3.8.2 - memoizerific: ^1.11.3 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 94cb7ff6b7881159a6cf9adc56ab310e67a8c2e89cbbb50517815871c45324354d0be584d23951c9a5a8e9e0d21172bf3eb9e0bd927feee04fbe9c0b054307eb - languageName: node - linkType: hard - "@storybook/types@7.0.0-beta.12, @storybook/types@workspace:*, @storybook/types@workspace:lib/types": version: 0.0.0-use.local resolution: "@storybook/types@workspace:lib/types" @@ -7621,6 +7558,20 @@ __metadata: languageName: unknown linkType: soft +"@storybook/types@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/types@npm:7.0.0-beta.13" + dependencies: + "@babel/core": ^7.12.10 + "@storybook/channels": 7.0.0-beta.13 + "@types/babel__core": ^7.0.0 + "@types/express": ^4.7.0 + express: ^4.17.3 + file-system-cache: ^2.0.0 + checksum: 59414ddb0e4a531ed78e7fb7dbab7b4f5008ecd338d3c9b474a2c936926d60e4e0c570ac59ffd483789d133b04f17958affd8aef24781ebf2f54a3bc78990d58 + languageName: node + linkType: hard + "@storybook/vue-vite@workspace:frameworks/vue-vite": version: 0.0.0-use.local resolution: "@storybook/vue-vite@workspace:frameworks/vue-vite" @@ -8400,13 +8351,6 @@ __metadata: languageName: node linkType: hard -"@types/is-function@npm:^1.0.0": - version: 1.0.1 - resolution: "@types/is-function@npm:1.0.1" - checksum: 3bd8cf70ef103141bf6bb0404bca6887766615bb655f967a0e46cf301e277b59eaeab8b91ce117331ce5c7c8875050796d06c25bf3da4531e3a4514269373c3c - languageName: node - linkType: hard - "@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": version: 2.0.4 resolution: "@types/istanbul-lib-coverage@npm:2.0.4" @@ -13374,7 +13318,7 @@ __metadata: languageName: node linkType: hard -"core-js@npm:^3.0.4, core-js@npm:^3.6.5, core-js@npm:^3.8.2": +"core-js@npm:^3.0.4, core-js@npm:^3.8.2": version: 3.26.1 resolution: "core-js@npm:3.26.1" checksum: 82d36c6f54fc0349998fa7fc67d200ba272f1cd1674c6786dc17f9d259d6555fc05662044528eae73ad6e90f71d503ab5c060ad4745492ef804308209f9aec13 @@ -19633,13 +19577,6 @@ __metadata: languageName: node linkType: hard -"is-function@npm:^1.0.2": - version: 1.0.2 - resolution: "is-function@npm:1.0.2" - checksum: c55289042a0e828a773f1245e2652e0c029efacc78ebe03e61787746fda74e2c41006cd908f20b53c36e45f9e75464475a4b2d68b17f4c7b9f8018bcaec42f9e - languageName: node - linkType: hard - "is-generator-fn@npm:^2.0.0": version: 2.1.0 resolution: "is-generator-fn@npm:2.1.0" @@ -19822,7 +19759,7 @@ __metadata: languageName: node linkType: hard -"is-regex@npm:^1.0.3, is-regex@npm:^1.0.4, is-regex@npm:^1.0.5, is-regex@npm:^1.1.0, is-regex@npm:^1.1.2, is-regex@npm:^1.1.4": +"is-regex@npm:^1.0.3, is-regex@npm:^1.0.4, is-regex@npm:^1.0.5, is-regex@npm:^1.1.0, is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" dependencies: @@ -20053,13 +19990,6 @@ __metadata: languageName: node linkType: hard -"isobject@npm:^4.0.0": - version: 4.0.0 - resolution: "isobject@npm:4.0.0" - checksum: 8efcda03af98cbb193737e30ffb77c71ca4e97dbf919f7aacec44b7410a166fa4e9fd71232bf5b00a919f98b5747ae359dbb5a5bc4195c93f6291423b9707df6 - languageName: node - linkType: hard - "isomorphic-unfetch@npm:^3.1.0": version: 3.1.0 resolution: "isomorphic-unfetch@npm:3.1.0" @@ -21288,9 +21218,9 @@ __metadata: linkType: hard "jquery@npm:^3.5.1": - version: 3.6.2 - resolution: "jquery@npm:3.6.2" - checksum: 4746ca404f56ab5abe21ba49d05fe809491d618ed2b2a37ed0a745f0744af88fe34e525bdb85335d239425f87161acef7b8ea917727f5fa9f9700e9e72047f3e + version: 3.6.3 + resolution: "jquery@npm:3.6.3" + checksum: e507b74e078761464620f8dd407fc9cc576892ffb8852a94c22b2f3371f028c97c8fb2ceaea895a4dbc0dd97106b3c35ab3e552c36516bf6cfd6ec84489fcef6 languageName: node linkType: hard @@ -23405,11 +23335,11 @@ __metadata: linkType: hard "minimatch@npm:^5.0.1, minimatch@npm:^5.1.1": - version: 5.1.1 - resolution: "minimatch@npm:5.1.1" + version: 5.1.2 + resolution: "minimatch@npm:5.1.2" dependencies: brace-expansion: ^2.0.1 - checksum: 375a71b6e83b35c4c555c2fc885822bfa140c3d105e536f0e4652fdcf0872d9d70955376a39230475683f4fa7eb7bec37d29dc9ab2a1b8008e48697f52e198b1 + checksum: 1376e34455e8eb1a493ea648571a0c449b99c44753aa3a562204b68dfea3ebd40193b9132d67c0e4adddeb9311a53173252664aafeba6516e5101c99fb6d0171 languageName: node linkType: hard @@ -27772,7 +27702,7 @@ __metadata: languageName: node linkType: hard -"regenerator-runtime@npm:^0.13.11, regenerator-runtime@npm:^0.13.2, regenerator-runtime@npm:^0.13.4, regenerator-runtime@npm:^0.13.7": +"regenerator-runtime@npm:^0.13.11, regenerator-runtime@npm:^0.13.2, regenerator-runtime@npm:^0.13.4": version: 0.13.11 resolution: "regenerator-runtime@npm:0.13.11" checksum: 12b069dc774001fbb0014f6a28f11c09ebfe3c0d984d88c9bced77fdb6fedbacbca434d24da9ae9371bfbf23f754869307fb51a4c98a8b8b18e5ef748677ca24 @@ -30169,7 +30099,7 @@ __metadata: languageName: node linkType: hard -"store2@npm:^2.12.0, store2@npm:^2.14.2": +"store2@npm:^2.14.2": version: 2.14.2 resolution: "store2@npm:2.14.2" checksum: 2f27c3eaa7207b81410e170e7c41379816d22c1566308a9d97fbf853c4facff531fcb2a85f085c7503c578736570972f747c26018ebeaba7d1341fb82a7b6d52 @@ -30698,8 +30628,8 @@ __metadata: linkType: hard "svelte-check@npm:^2.9.2": - version: 2.10.2 - resolution: "svelte-check@npm:2.10.2" + version: 2.10.3 + resolution: "svelte-check@npm:2.10.3" dependencies: "@jridgewell/trace-mapping": ^0.3.9 chokidar: ^3.4.1 @@ -30713,7 +30643,7 @@ __metadata: svelte: ^3.24.0 bin: svelte-check: bin/svelte-check - checksum: 568401af63080517ec91d91d16e51ed33acba9953c3e6e56336c6ec13bfcff3ce8e6e17cadc064f15e6ff24b060c0ff5b41e3307f204ecd5a732ef072450984a + checksum: a327d1b5621af17e717f5353410f91e20031682c10ff0c0fa4d3692e617aacd0190895da0664efa21fae5c76c3c9e1efcb5d52860c04fcaedc39cfefa3dd6066 languageName: node linkType: hard @@ -30961,22 +30891,6 @@ __metadata: languageName: node linkType: hard -"telejson@npm:^6.0.8": - version: 6.0.8 - resolution: "telejson@npm:6.0.8" - dependencies: - "@types/is-function": ^1.0.0 - global: ^4.4.0 - is-function: ^1.0.2 - is-regex: ^1.1.2 - is-symbol: ^1.0.3 - isobject: ^4.0.0 - lodash: ^4.17.21 - memoizerific: ^1.11.3 - checksum: b9b723259504a24eae3343ca2c1020fd74e748dc7d6e532ca8171d8c3f678418f06708e2332c452480a9c8d56f8abe01e33b9e1ca3153a7bcd7640cdbfa3317b - languageName: node - linkType: hard - "telejson@npm:^7.0.3": version: 7.0.4 resolution: "telejson@npm:7.0.4" diff --git a/scripts/package.json b/scripts/package.json index d960b5937c5e..5a72f92d4799 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -52,7 +52,7 @@ "@storybook/eslint-config-storybook": "^3.1.2", "@storybook/jest": "^0.0.10", "@storybook/linter-config": "^3.1.2", - "@storybook/testing-library": "0.0.14-next.0", + "@storybook/testing-library": "next", "@swc/core": "^1.3.23", "@testing-library/dom": "^7.29.4", "@testing-library/jest-dom": "^5.11.9", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 69f85e420f4a..baf2d3e4528c 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -77,7 +77,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.17.5, @babel/core@npm:^7.20.2": +"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.17.5, @babel/core@npm:^7.20.2": version: 7.20.5 resolution: "@babel/core@npm:7.20.5" dependencies: @@ -3005,6 +3005,20 @@ __metadata: languageName: node linkType: hard +"@storybook/channel-postmessage@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/channel-postmessage@npm:7.0.0-beta.13" + dependencies: + "@storybook/channels": 7.0.0-beta.13 + "@storybook/client-logger": 7.0.0-beta.13 + "@storybook/core-events": 7.0.0-beta.13 + "@storybook/global": ^5.0.0 + qs: ^6.10.0 + telejson: ^7.0.3 + checksum: ceff9b76a59b93aceef9b36cadc935ec78f7a6686185da9cc19f3d58595ec43b8fa989772f1cdc1244094773311aeefe96fabc085d64d8c45b93d4a1ef5f9ce7 + languageName: node + linkType: hard + "@storybook/channels@npm:6.5.14": version: 6.5.14 resolution: "@storybook/channels@npm:6.5.14" @@ -3016,7 +3030,14 @@ __metadata: languageName: node linkType: hard -"@storybook/client-logger@npm:6.5.14, @storybook/client-logger@npm:^6.4.0": +"@storybook/channels@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/channels@npm:7.0.0-beta.13" + checksum: 97a5b95160b8f4f3addae0f7e32173f443465b3972f570525ff49016afb424089fc53b6775618e8d637203981f7efd11646c3552ab1fbf8966a7c14f49fc6260 + languageName: node + linkType: hard + +"@storybook/client-logger@npm:6.5.14": version: 6.5.14 resolution: "@storybook/client-logger@npm:6.5.14" dependencies: @@ -3026,6 +3047,15 @@ __metadata: languageName: node linkType: hard +"@storybook/client-logger@npm:7.0.0-beta.13, @storybook/client-logger@npm:next": + version: 7.0.0-beta.13 + resolution: "@storybook/client-logger@npm:7.0.0-beta.13" + dependencies: + "@storybook/global": ^5.0.0 + checksum: 7707d6cda7494336b494bfe92c7a43e0c5566f66606545b635613c17898422bc548502ca53c8d0f3aea6bcdb62a30e0179848c2bde588e0e90e2a3f55771d684 + languageName: node + linkType: hard + "@storybook/core-events@npm:6.5.14": version: 6.5.14 resolution: "@storybook/core-events@npm:6.5.14" @@ -3035,6 +3065,13 @@ __metadata: languageName: node linkType: hard +"@storybook/core-events@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/core-events@npm:7.0.0-beta.13" + checksum: d186f5be6e761ae5e1c82a422fc2a6d39baca8be8e5acf7a65974935e33acdc3891e9f814f8d71031caaee12ba059f24d074f9725af684e8af07acfa105fcd43 + languageName: node + linkType: hard + "@storybook/csf@npm:0.0.2--canary.4566f4d.1": version: 0.0.2--canary.4566f4d.1 resolution: "@storybook/csf@npm:0.0.2--canary.4566f4d.1" @@ -3053,6 +3090,17 @@ __metadata: languageName: node linkType: hard +"@storybook/csf@npm:next": + version: 0.0.2-next.8 + resolution: "@storybook/csf@npm:0.0.2-next.8" + dependencies: + expect-type: ^0.14.2 + lodash: ^4.17.15 + type-fest: ^2.19.0 + checksum: 86f5599c030b87cbab6fa5e4b4a9ef1aeed5e838b993b2bae5f0fc50d79ae80d5cfbf2590a05bae0a95068ef77eec88d8c102072d63c77745afe74f91cfa03a3 + languageName: node + linkType: hard + "@storybook/eslint-config-storybook@npm:^3.1.2": version: 3.1.2 resolution: "@storybook/eslint-config-storybook@npm:3.1.2" @@ -3071,6 +3119,13 @@ __metadata: languageName: node linkType: hard +"@storybook/global@npm:^5.0.0": + version: 5.0.0 + resolution: "@storybook/global@npm:5.0.0" + checksum: 8f1b61dcdd3a89584540896e659af2ecc700bc740c16909a7be24ac19127ea213324de144a141f7caf8affaed017d064fea0618d453afbe027cf60f54b4a6d0b + languageName: node + linkType: hard + "@storybook/instrumenter@npm:^6.4.0": version: 6.5.14 resolution: "@storybook/instrumenter@npm:6.5.14" @@ -3084,6 +3139,20 @@ __metadata: languageName: node linkType: hard +"@storybook/instrumenter@npm:next": + version: 7.0.0-beta.13 + resolution: "@storybook/instrumenter@npm:7.0.0-beta.13" + dependencies: + "@storybook/channels": 7.0.0-beta.13 + "@storybook/client-logger": 7.0.0-beta.13 + "@storybook/core-events": 7.0.0-beta.13 + "@storybook/global": ^5.0.0 + "@storybook/preview-api": 7.0.0-beta.13 + core-js: ^3.8.2 + checksum: aeefe99fa9bc2fe9f1cfa848a9f09e3888e38d2fba35cee02bc64ebaa31a080b70477d021b9a9b7b5cefa3c01b44ad93ef5d89715ebdea4428fe02845c6378b7 + languageName: node + linkType: hard + "@storybook/jest@npm:^0.0.10": version: 0.0.10 resolution: "@storybook/jest@npm:0.0.10" @@ -3123,6 +3192,30 @@ __metadata: languageName: node linkType: hard +"@storybook/preview-api@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/preview-api@npm:7.0.0-beta.13" + dependencies: + "@storybook/channel-postmessage": 7.0.0-beta.13 + "@storybook/channels": 7.0.0-beta.13 + "@storybook/client-logger": 7.0.0-beta.13 + "@storybook/core-events": 7.0.0-beta.13 + "@storybook/csf": next + "@storybook/global": ^5.0.0 + "@storybook/types": 7.0.0-beta.13 + "@types/qs": ^6.9.5 + dequal: ^2.0.2 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + qs: ^6.10.0 + slash: ^3.0.0 + synchronous-promise: ^2.0.15 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + checksum: faa4cce65d03b21ce7802838fa7e000ab28ab2674e0d82185c58c54ad1d79eff00a5d1ac059d5a0aab50af205e83b0f43bcd53538ae5f8285fbe0ff2a0a301c5 + languageName: node + linkType: hard + "@storybook/router@npm:6.5.14": version: 6.5.14 resolution: "@storybook/router@npm:6.5.14" @@ -3157,7 +3250,7 @@ __metadata: "@storybook/eslint-config-storybook": ^3.1.2 "@storybook/jest": ^0.0.10 "@storybook/linter-config": ^3.1.2 - "@storybook/testing-library": 0.0.14-next.0 + "@storybook/testing-library": next "@swc/core": ^1.3.23 "@testing-library/dom": ^7.29.4 "@testing-library/jest-dom": ^5.11.9 @@ -3286,16 +3379,16 @@ __metadata: languageName: node linkType: hard -"@storybook/testing-library@npm:0.0.14-next.0": - version: 0.0.14-next.0 - resolution: "@storybook/testing-library@npm:0.0.14-next.0" +"@storybook/testing-library@npm:next": + version: 0.0.14-next.1 + resolution: "@storybook/testing-library@npm:0.0.14-next.1" dependencies: - "@storybook/client-logger": ^6.4.0 - "@storybook/instrumenter": ^6.4.0 + "@storybook/client-logger": next + "@storybook/instrumenter": next "@testing-library/dom": ^8.3.0 "@testing-library/user-event": ^13.2.1 ts-dedent: ^2.2.0 - checksum: fd10ebddd305743f4388ad939b90fed155b6c3a755e96a73f72d38d9afe2546a22be0c9a5d83b8b6d91742dd7be5d2e7dfcbbd630b2fa97e4ef7dde00f0824b0 + checksum: 0d386dd136c5f6a5e695247eb7c7fa10182cb73150aae9744d6b7197c6cd049dfeffbbe192c06131858a346726b80e6fa28e8ac7a0f0012759f6f092b219cd61 languageName: node linkType: hard @@ -3314,6 +3407,20 @@ __metadata: languageName: node linkType: hard +"@storybook/types@npm:7.0.0-beta.13": + version: 7.0.0-beta.13 + resolution: "@storybook/types@npm:7.0.0-beta.13" + dependencies: + "@babel/core": ^7.12.10 + "@storybook/channels": 7.0.0-beta.13 + "@types/babel__core": ^7.0.0 + "@types/express": ^4.7.0 + express: ^4.17.3 + file-system-cache: ^2.0.0 + checksum: 59414ddb0e4a531ed78e7fb7dbab7b4f5008ecd338d3c9b474a2c936926d60e4e0c570ac59ffd483789d133b04f17958affd8aef24781ebf2f54a3bc78990d58 + languageName: node + linkType: hard + "@stroncium/procfs@npm:^1.2.1": version: 1.2.1 resolution: "@stroncium/procfs@npm:1.2.1" @@ -3566,7 +3673,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.1.14": +"@types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14": version: 7.1.20 resolution: "@types/babel__core@npm:7.1.20" dependencies: @@ -3684,7 +3791,7 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:^4.17.11": +"@types/express@npm:^4.17.11, @types/express@npm:^4.7.0": version: 4.17.15 resolution: "@types/express@npm:4.17.15" dependencies: @@ -3920,7 +4027,7 @@ __metadata: languageName: node linkType: hard -"@types/qs@npm:*": +"@types/qs@npm:*, @types/qs@npm:^6.9.5": version: 6.9.7 resolution: "@types/qs@npm:6.9.7" checksum: 157eb05f4c75790b0ebdcf7b0547ff117feabc8cda03c3cac3d3ea82bb19a1912e76a411df3eb0bdd01026a9770f07bc0e7e3fbe39ebb31c1be4564c16be35f1 @@ -6792,6 +6899,13 @@ __metadata: languageName: node linkType: hard +"dequal@npm:^2.0.2": + version: 2.0.3 + resolution: "dequal@npm:2.0.3" + checksum: f98860cdf58b64991ae10205137c0e97d384c3a4edc7f807603887b7c4b850af1224a33d88012009f150861cbee4fa2d322c4cc04b9313bee312e47f6ecaa888 + languageName: node + linkType: hard + "destroy@npm:1.2.0": version: 1.2.0 resolution: "destroy@npm:1.2.0" @@ -8370,6 +8484,13 @@ __metadata: languageName: node linkType: hard +"expect-type@npm:^0.14.2": + version: 0.14.2 + resolution: "expect-type@npm:0.14.2" + checksum: 862d5cb25a07b1dc26032ceeab2975f047e641175db2d3bbb34cee73ed8c04ca5e93457cc59ddf5006ddd7a694eb0e0bf2537512caa41e533a2044ed9d13a775 + languageName: node + linkType: hard + "expect@npm:^28.1.3": version: 28.1.3 resolution: "expect@npm:28.1.3" @@ -8688,6 +8809,16 @@ __metadata: languageName: node linkType: hard +"file-system-cache@npm:^2.0.0": + version: 2.0.1 + resolution: "file-system-cache@npm:2.0.1" + dependencies: + fs-extra: ^10.1.0 + ramda: ^0.28.0 + checksum: 1efe6fdd02835d9810565ed4e5c5f2c383014d0439771779335ab4fefa4cf03f673415fe8140c40f50ca31ee135f373aefa82def079c6caaab8963a09e7fd0fd + languageName: node + linkType: hard + "filelist@npm:^1.0.1": version: 1.0.4 resolution: "filelist@npm:1.0.4" @@ -14672,6 +14803,13 @@ __metadata: languageName: node linkType: hard +"ramda@npm:^0.28.0": + version: 0.28.0 + resolution: "ramda@npm:0.28.0" + checksum: 0f9dc0cc3b0432ff047f1e2a5e58860c531a84574674c0f52fef535efc6e1e07fa3851102fff3da7dd551a592c743f6f6fa521379a6aa5fe50266f8af8f0b570 + languageName: node + linkType: hard + "randexp@npm:0.4.6": version: 0.4.6 resolution: "randexp@npm:0.4.6" @@ -16608,6 +16746,13 @@ __metadata: languageName: node linkType: hard +"synchronous-promise@npm:^2.0.15": + version: 2.0.16 + resolution: "synchronous-promise@npm:2.0.16" + checksum: b0cbad61b24b36ab1a8c6ac5b10335ad7c1a006b69bf5e73e5de9a141a54abaef20b4b808a9939e81dc52cf27f4c4c7a62e90cec42a0005efda712618985ba5a + languageName: node + linkType: hard + "syntax-error@npm:^1.1.6": version: 1.4.0 resolution: "syntax-error@npm:1.4.0" @@ -16694,6 +16839,15 @@ __metadata: languageName: node linkType: hard +"telejson@npm:^7.0.3": + version: 7.0.4 + resolution: "telejson@npm:7.0.4" + dependencies: + memoizerific: ^1.11.3 + checksum: c23c2b6baf3f1c195f7c0b0c34e8c53b490e42324cde06fab52a8de9216ef0b59af81d396b882a47cbe8c0cebc9563e45a3d52a50a5e0b45cddfbf2bab94ce86 + languageName: node + linkType: hard + "temp-dir@npm:^2.0.0": version: 2.0.0 resolution: "temp-dir@npm:2.0.0" @@ -17194,6 +17348,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^2.19.0": + version: 2.19.0 + resolution: "type-fest@npm:2.19.0" + checksum: a5a7ecf2e654251613218c215c7493574594951c08e52ab9881c9df6a6da0aeca7528c213c622bc374b4e0cb5c443aa3ab758da4e3c959783ce884c3194e12cb + languageName: node + linkType: hard + "type-fest@npm:^3.0.0, type-fest@npm:^3.4.0": version: 3.4.0 resolution: "type-fest@npm:3.4.0" From 7acafefbaea15e4cb77f7157fb20cb6af4e67c52 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 20 Dec 2022 23:05:14 +0100 Subject: [PATCH 3/3] fixes for unit tests --- .gitignore | 1 + code/.gitignore | 1 + code/.swcrc | 24 ++++++++++++++ .../{preview.js => preview.jsx} | 0 code/jest.config.base.js | 2 +- .../{shortcuts.test.js => shortcuts.test.tsx} | 32 ++++++++++++++++++- 6 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 code/.swcrc rename code/addons/storyshots/storyshots-core/stories/exported_metadata/{preview.js => preview.jsx} (100%) rename code/ui/manager/src/settings/{shortcuts.test.js => shortcuts.test.tsx} (76%) diff --git a/.gitignore b/.gitignore index cdef5b1ac8cb..e36944229f1c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules .idea *.iml *.sw* +!.swcrc dist *.DS_Store .cache diff --git a/code/.gitignore b/code/.gitignore index e57a79e7046b..2a1fc46598f8 100644 --- a/code/.gitignore +++ b/code/.gitignore @@ -3,6 +3,7 @@ node_modules .idea *.iml *.sw* +!.swcrc npm-shrinkwrap.json dist .tern-port diff --git a/code/.swcrc b/code/.swcrc new file mode 100644 index 000000000000..0f49911d3870 --- /dev/null +++ b/code/.swcrc @@ -0,0 +1,24 @@ +{ + "$schema": "https://json.schemastore.org/swcrc", + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": true + }, + "transform": { + "react": { + "runtime": "classic", + "pragma": "React.createElement", + "pragmaFrag": "React.Fragment", + "throwIfNamespace": false, + "development": false + } + }, + "target": "es2020", + "loose": false, + "externalHelpers": false, + // Requires v1.2.50 or upper and requires target to be es2016 or upper. + "keepClassNames": false + }, + "minify": false +} \ No newline at end of file diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/preview.js b/code/addons/storyshots/storyshots-core/stories/exported_metadata/preview.jsx similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/preview.js rename to code/addons/storyshots/storyshots-core/stories/exported_metadata/preview.jsx diff --git a/code/jest.config.base.js b/code/jest.config.base.js index c24f2699d32d..5c0d0c19ea1e 100644 --- a/code/jest.config.base.js +++ b/code/jest.config.base.js @@ -26,7 +26,7 @@ module.exports = { '\\.(md)$': path.resolve('./__mocks__/htmlMock.js'), }, transform: { - '^.+\\.(t|j)sx?$': ['@swc/jest'], + '^.+\\.(t|j)sx?$': '@swc/jest', '^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx', }, transformIgnorePatterns: ['/node_modules/(?!@angular|rxjs|nanoid|uuid|lit-html|@mdx-js)'], diff --git a/code/ui/manager/src/settings/shortcuts.test.js b/code/ui/manager/src/settings/shortcuts.test.tsx similarity index 76% rename from code/ui/manager/src/settings/shortcuts.test.js rename to code/ui/manager/src/settings/shortcuts.test.tsx index 730df69161a7..8e92195335af 100644 --- a/code/ui/manager/src/settings/shortcuts.test.js +++ b/code/ui/manager/src/settings/shortcuts.test.tsx @@ -14,7 +14,7 @@ const shortcutKeys = { search: ['/'], focusNav: ['1'], focusIframe: ['2'], -}; +} as any; const makeActions = () => ({ setShortcut: jest.fn(), @@ -48,7 +48,9 @@ describe('ShortcutsScreen', () => { const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('toolbar')(); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').toolbar.shortcut).toBeNull(); expect(comp.state('activeFeature')).toBe('toolbar'); }); @@ -59,9 +61,12 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) instance.onKeyDown({ isShift: true, key: 'Shift' }); expect(actions.setShortcut).not.toHaveBeenCalled(); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toBeNull(); }); @@ -69,10 +74,14 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) instance.onKeyDown({ key: 'P' }); expect(actions.setShortcut).not.toHaveBeenCalled(); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toEqual(['P']); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.error).toBe(false); }); @@ -80,10 +89,14 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) instance.onKeyDown({ key: 'F' }); expect(actions.setShortcut).not.toHaveBeenCalled(); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toEqual(['F']); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.error).toBe(true); }); }); @@ -93,12 +106,16 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) await instance.onBlur(); expect(actions.setShortcut).not.toHaveBeenCalled(); expect(actions.restoreDefaultShortcut).toHaveBeenCalledWith('focusIframe'); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toEqual(['2']); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.error).toBe(false); }); @@ -106,13 +123,18 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) instance.onKeyDown({ key: 'F' }); + // @ts-expect-error (please let's get rid of enzyme) await instance.onBlur(); expect(actions.setShortcut).not.toHaveBeenCalled(); expect(actions.restoreDefaultShortcut).toHaveBeenCalledWith('focusIframe'); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toEqual(['2']); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.error).toBe(false); }); @@ -120,12 +142,17 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) instance.onKeyDown({ key: 'P' }); + // @ts-expect-error (please let's get rid of enzyme) instance.onBlur(); expect(actions.setShortcut).toHaveBeenCalledWith('focusIframe', ['P']); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toEqual(['P']); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.error).toBe(false); }); }); @@ -135,10 +162,13 @@ describe('ShortcutsScreen', () => { const actions = makeActions(); const comp = shallow(); const instance = comp.instance(); + // @ts-expect-error (please let's get rid of enzyme) instance.onFocus('focusIframe')(); + // @ts-expect-error (please let's get rid of enzyme) instance.onKeyDown({ key: 'P' }); await comp.find('#restoreDefaultsHotkeys').simulate('click'); + // @ts-expect-error (please let's get rid of enzyme) expect(comp.state('shortcutKeys').focusIframe.shortcut).toEqual(['2']); }); });