Skip to content

Commit 613dacd

Browse files
committed
chore(vitest): minor fixes and unused dependencies removed
1 parent f8dac7f commit 613dacd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+158
-872
lines changed

package.json

-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"@mdx-js/preact": "^2.1.2",
3636
"@mdx-js/react": "^2.1.1",
3737
"@nrwl/eslint-plugin-nx": "14.1.5",
38-
"@nrwl/jest": "14.1.9",
3938
"@nrwl/js": "14.1.9",
4039
"@nrwl/linter": "14.1.5",
4140
"@storybook/addon-essentials": "^6.4.22",
@@ -47,7 +46,6 @@
4746
"@storybook/testing-react": "^1.2.4",
4847
"@testing-library/jest-dom": "^5.16.4",
4948
"@testing-library/react": "^13.2.0",
50-
"@types/jest": "^27.5.1",
5149
"@types/node": "^17.0.26",
5250
"@types/react": "^18.0.6",
5351
"@types/react-dom": "^18.0.2",
@@ -61,8 +59,6 @@
6159
"eslint": "~8.12.0",
6260
"eslint-config-prettier": "8.1.0",
6361
"fast-glob": "^3.2.11",
64-
"jest": "^28.1.0",
65-
"jest-styled-components": "^7.0.8",
6662
"msw": "^0.42.1",
6763
"msw-storybook-addon": "^1.6.3",
6864
"node-polyfill-webpack-plugin": "^1.1.4",
@@ -74,7 +70,6 @@
7470
"rollup-plugin-node-builtins": "^2.1.2",
7571
"storybook": "^6.5.8",
7672
"styled-components": "^5.3.5",
77-
"ts-jest": "27.1.4",
7873
"ts-node": "9.1.1",
7974
"typescript": "^4.6.3",
8075
"vite": "^2.9.5",

packages/core/src/IconsGallery/Icon.test.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { render, screen } from '@testing-library/react';
22
import * as Icons from '@web3uikit/icons';
3-
3+
import { test, expect } from 'vitest';
4+
import React from 'react';
45
const testIconId = 'test-icon';
6+
import '@testing-library/jest-dom';
57

68
Object.values(Icons).forEach((Icon, index) => {
79
test(`Renders - ${Icon.name} Icon`, () => {

packages/core/src/lib/Accordion/Accordion.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { composeStories } from '@storybook/testing-react';
33
import * as stories from './Accordion.stories';
44
import { tagTestId } from '../Tag/Tag.test';
55
import { color } from '@web3uikit/styles';
6+
import { test, expect, describe } from 'vitest';
67

78
const { Default, FullDemo, HasIcon, HasSubtitle, HasTag, ThemeColor } =
89
composeStories(stories);

packages/core/src/lib/Avatar/Avatar.test.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
import { composeStories } from '@storybook/testing-react';
32
import * as stories from './Avatar.stories';
43
import { roundedEdgeValue } from './Avatar.styles';
54
import { render, screen } from '@testing-library/react';
5+
import { test, expect, describe } from 'vitest';
66

77
const {
88
AvatarImageDefault,
@@ -123,9 +123,7 @@ test('Avatar - CustomSizeAndFontSize', () => {
123123

124124
// It has a custom font size
125125
const styles = element && getComputedStyle(element);
126-
expect(styles?.fontSize).toBe(
127-
`${CustomSizeAndFontSize?.args?.fontSize}px`,
128-
);
126+
expect(styles?.fontSize).toBe(`${CustomSizeAndFontSize?.args?.fontSize}px`);
129127

130128
// It has a custom size
131129
expect(styles?.width).toBe(`${CustomSizeAndFontSize?.args?.size}px`);

packages/core/src/lib/Badge/Badge.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as stories from './Badge.stories';
2+
import { test, expect, describe } from 'vitest';
23

34
import { render, screen } from '@testing-library/react';
45
import { color, rgbToHex } from '@web3uikit/styles';

packages/core/src/lib/BannerStrip/BannerStrip.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { render, screen } from '@testing-library/react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './BannerStrip.stories';
44
import { color, rgbToHex } from '@web3uikit/styles';
5+
import { test, expect, describe } from 'vitest';
56

67
const { Standard, StandardWithButton, Warning, Error, Success } =
78
composeStories(stories);

packages/core/src/lib/Breadcrumbs/Breadcrumbs.test.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { fireEvent, waitFor, screen, render } from '@testing-library/react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './Breadcrumbs.stories';
44
import { color } from '@web3uikit/styles';
5-
6-
import 'jest-styled-components';
7-
5+
import { test, expect, describe } from 'vitest';
86
const { One, Two, Three, Four } = composeStories(stories);
97

108
const olId = 'breadcrumbs-ol-test-id';

packages/core/src/lib/Button/Button.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { cleanup, fireEvent, render } from '@testing-library/react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './Button.stories';
44
import { color, rgbToHex } from '@web3uikit/styles';
5+
import { test, expect, describe, vi } from 'vitest';
56

6-
import { vi } from 'vitest';
77
const {
88
ColoredBlue,
99
ColoredGreen,

packages/core/src/lib/Card/Card.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
import { render, screen } from '@testing-library/react';
32
import { composeStories } from '@storybook/testing-react';
43
import * as stories from './Card.stories';
4+
import { test, expect, describe } from 'vitest';
55

66
const { Regular, RegularSelected, Disabled } = composeStories(stories);
77

packages/core/src/lib/ChainSelector/ChainSelector.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { render, screen } from '@testing-library/react';
2+
import { test, expect, describe } from 'vitest';
23

34
import ChainSelector from './ChainSelector';
45

packages/core/src/lib/Checkbox/Checkbox.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { composeStories } from '@storybook/testing-react';
22
import * as stories from './Checkbox.stories';
33
import { render, screen, fireEvent } from '@testing-library/react';
4-
import { vi } from 'vitest';
4+
import { test, expect, describe, vi } from 'vitest';
5+
56
const {
67
Box,
78
BoxDisabled,

packages/core/src/lib/CodeArea/CodeArea.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { composeStories } from '@storybook/testing-react';
22
import { CodeArea } from '.';
33
import '@testing-library/jest-dom';
44
import { render, screen, fireEvent } from '@testing-library/react';
5+
import { test, expect, describe } from 'vitest';
56

67
import { color } from '@web3uikit/styles';
78
import * as stories from './CodeArea.stories';

packages/core/src/lib/CopyButton/CopyButton.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
act,
66
waitFor,
77
} from '@testing-library/react';
8+
import { test, expect, describe } from 'vitest';
89

910
import CopyButton from './CopyButton';
1011

packages/core/src/lib/Credentials/Credentials.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { composeStories } from '@storybook/testing-react';
22
import * as stories from './Credentials.stories';
33
import { render, screen } from '@testing-library/react';
4+
import { test, expect, describe } from 'vitest';
45

56
const { WithTitleAndIcon, WithTitle, OneLine } = composeStories(stories);
67

packages/core/src/lib/CryptoCards/CryptoCards.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { fireEvent, render, screen } from '@testing-library/react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './CryptoCards.stories';
44
import { color, rgbToHex } from '@web3uikit/styles';
5-
import 'jest-styled-components';
5+
66
import '@testing-library/jest-dom/extend-expect';
7-
import { vi } from 'vitest';
7+
import { test, expect, describe, vi } from 'vitest';
88

99
const { Ethereum, Binance, Polygon, Avalanche, Fantom, Arbitrum } =
1010
composeStories(stories);

packages/core/src/lib/CryptoLogos/CryptoLogos.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { composeStories } from '@storybook/testing-react';
22
import * as stories from './CryptoLogos.stories';
33
import { color, rgbToHex } from '@web3uikit/styles';
4-
import 'jest-styled-components';
4+
import { test, expect, describe } from 'vitest';
5+
56
import '@testing-library/jest-dom/extend-expect';
67
import { render, screen } from '@testing-library/react';
78

packages/core/src/lib/DatePicker/DatePicker.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { render, screen } from '@testing-library/react';
22
import DatePicker from './DatePicker';
3+
import { test, expect, describe } from 'vitest';
34

45
const datePickerTestId = 'test-date-picker';
56
const datePickerIcon = 'date-picker_icon';

packages/core/src/lib/Dropdown/Dropdown.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
21
import { render, screen, fireEvent } from '@testing-library/react';
32
import { composeStories } from '@storybook/testing-react';
43
import * as stories from './Dropdown.stories';
4+
import { test, expect, describe } from 'vitest';
5+
56
const { Default, ControlledState, NonFixedLabel, Iconless } =
67
composeStories(stories);
78

packages/core/src/lib/Form/Form.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { configure, render, screen } from '@testing-library/react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './Form.stories';
4+
import { test, expect, describe } from 'vitest';
45

56
const { DemoForm } = composeStories(stories);
67
const formTestID = 'test-form';

packages/core/src/lib/Hero/Hero.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { render, screen } from '@testing-library/react';
33
import Hero from './Hero';
44
import { Button } from '../Button';
55
import { color, rgbToHex } from '@web3uikit/styles';
6+
import { test, expect, describe } from 'vitest';
67

78
const testTitle = 'never test a Hero';
89
const testBgURL =

packages/core/src/lib/HideButton/HideButton.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { composeStories } from '@storybook/testing-react';
22
import * as stories from './HideButton.stories';
33
import { render, screen } from '@testing-library/react';
4+
import { test, expect, describe } from 'vitest';
45

56
const { Default, HiddenState } = composeStories(stories);
67

packages/core/src/lib/Info/Information.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
import { composeStories } from '@storybook/testing-react';
32
import * as stories from './Information.stories';
43
import { render, screen } from '@testing-library/react';
4+
import { test, expect, describe } from 'vitest';
55

66
const { Regular } = composeStories(stories);
77

packages/core/src/lib/Input/Input.test.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { cleanup, render, screen, fireEvent } from '@testing-library/react';
22
import '@testing-library/jest-dom';
3-
import 'jest-styled-components';
3+
44
import { composeStories } from '@storybook/testing-react';
55
import * as stories from './Input.stories';
6-
import { vi } from 'vitest';
6+
import { test, expect, describe, vi } from 'vitest';
7+
78
import { color, rgbToHex } from '@web3uikit/styles';
89

910
import Input from './Input';

packages/core/src/lib/LinkTo/LinkTo.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { composeStories } from '@storybook/testing-react';
22
import { fireEvent, render, screen } from '@testing-library/react';
33
import * as stories from './LinkTo.stories';
4-
import 'jest-styled-components';
4+
import { test, expect, describe } from 'vitest';
5+
56
import { color, rgbToHex } from '@web3uikit/styles';
67

78
const {

packages/core/src/lib/Loading/Loading.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './Loading.stories';
44
import { render, screen } from '@testing-library/react';
5+
import { test, expect, describe } from 'vitest';
56

67
const {
78
Loader,

packages/core/src/lib/Logo/Logo.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
import { composeStories } from '@storybook/testing-react';
32
import { render, screen } from '@testing-library/react';
43
import * as stories from './Logo.stories';
4+
import { test, expect, describe } from 'vitest';
55

66
const {
77
AmexRegular,

packages/core/src/lib/Modal/Modal.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Modal from './Modal';
33
import { Cloud } from '@web3uikit/icons';
44
import { color } from '@web3uikit/styles';
55
import { ModalProps } from './types';
6-
import { vi } from 'vitest';
6+
import { test, expect, describe, vi } from 'vitest';
77

88
const args: ModalProps = {
99
id: 'regular',

packages/core/src/lib/NewComp/NewComp.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { composeStories } from '@storybook/testing-react';
44
import { render, screen, fireEvent } from '@testing-library/react';
55
import * as stories from './NewComp.stories';
6+
import { test, expect, describe } from 'vitest';
67

78
// // importing fire event from RTL to mock a click event
89
// import { fireEvent } from '@testing-library/react';

packages/core/src/lib/Notification/Notification.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import 'jest-styled-components';
21
import * as stories from './Notification.stories';
3-
2+
import { test, expect, describe } from 'vitest';
43
import { render, cleanup } from '@testing-library/react';
54
import { composeStories } from '@storybook/testing-react';
65
const { Regular, Standard, CustomIcon } = composeStories(stories);

packages/core/src/lib/PlanCard/PlanCard.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
import { composeStories } from '@storybook/testing-react';
32
import { render, within } from '@testing-library/react';
43
import * as stories from './PlanCard.stories';
4+
import { test, expect, describe } from 'vitest';
55

66
const { PlanCardStory, CurrentPlanStory } = composeStories(stories);
77

packages/core/src/lib/PopoverDropdown/PopoverDropdown.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { composeStories } from '@storybook/testing-react';
32
import {
43
fireEvent,
@@ -8,7 +7,7 @@ import {
87
cleanup,
98
} from '@testing-library/react';
109
import * as stories from './PopoverDropdown.stories';
11-
import 'jest-styled-components';
10+
import { test, expect, describe } from 'vitest';
1211

1312
const { PopoverSelection } = composeStories(stories);
1413

packages/core/src/lib/PopoverElement/PopoverElement.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { fireEvent, render, cleanup } from '@testing-library/react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './PopoverElement.stories';
4-
import 'jest-styled-components';
5-
import { vi } from 'vitest';
4+
5+
import { test, expect, describe, vi } from 'vitest';
66

77
const { Default } = composeStories(stories);
88
const testClickEvent = vi.fn();

packages/core/src/lib/Radios/Radios.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { composeStories } from '@storybook/testing-react';
22
import { fireEvent, render, screen } from '@testing-library/react';
33

44
import * as stories from './Radios.stories';
5-
import { vi } from 'vitest';
5+
import { test, expect, describe, vi } from 'vitest';
66

77
const {
88
RadioGroup,

packages/core/src/lib/Row/Row.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { composeStories } from '@storybook/testing-react';
22
import { render, screen } from '@testing-library/react';
3+
import { test, expect, describe } from 'vitest';
34

45
import * as stories from './Row.stories';
56

packages/core/src/lib/Select/Select.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { composeStories } from '@storybook/testing-react';
22
import { render, screen } from '@testing-library/react';
3+
import { test, expect, describe } from 'vitest';
34

45
import { color } from '@web3uikit/styles';
56
import * as stories from './Select.stories';

packages/core/src/lib/Skeleton/Skeleton.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { cleanup, render } from '@testing-library/react';
44
import { color, rgbToHex } from '@web3uikit/styles';
55

66
import * as stories from './Skeleton.stories';
7+
import { test, expect, describe } from 'vitest';
78

89
const { SkeletonImage } = composeStories(stories);
910
const skeletonTestId = 'test-skeleton-id';

packages/core/src/lib/Stepper/Stepper.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { fireEvent, render, cleanup } from '@testing-library/react';
33
import { composeStories } from '@storybook/testing-react';
44
import * as stories from './Stepper.stories';
55
import { noNavTestStepData, testStepData } from './testStepData';
6+
import { test, expect, describe } from 'vitest';
67

78
const { Demo, PreLoadStep0, StepsWithFooter, StepsWithoutNav } =
89
composeStories(stories);

packages/core/src/lib/Table/Table.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as stories from './Table.stories';
44
import { render, fireEvent, screen } from '@testing-library/react';
5-
import { vi } from 'vitest';
5+
import { test, expect, describe, vi } from 'vitest';
66

77
const {
88
DefaultTable,

packages/core/src/lib/Tabs/Tabs.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import { composeStories } from '@storybook/testing-react';
33
import * as Stories from './Tabs.stories';
44
import { render, screen, fireEvent } from '@testing-library/react';
5+
import { test, expect, describe } from 'vitest';
56

67
const {
78
TabBar,

0 commit comments

Comments
 (0)