Skip to content

Commit

Permalink
chore(project): vite updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Aug 3, 2023
1 parent 7b61672 commit debf4a3
Show file tree
Hide file tree
Showing 7 changed files with 2,812 additions and 3,130 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@types/react-infinite-scroller": "^1.2.3",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"@vitejs/plugin-react": "^1.0.7",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.33.0",
"allure-commandline": "^2.17.2",
"codeceptjs": "3.4.1",
Expand All @@ -102,7 +102,7 @@
"faker": "^5.5.1",
"husky": "^6.0.0",
"i18next-parser": "^8.0.0",
"jsdom": "^19.0.0",
"jsdom": "^22.1.0",
"lint-staged": "^10.5.4",
"luxon": "^3.2.1",
"npm-run-all": "^4.1.5",
Expand All @@ -124,13 +124,13 @@
"tsconfig-paths": "^4.1.0",
"typescript": "^4.3.4",
"vi-fetch": "^0.8.0",
"vite": "^4.4.0",
"vite": "^4.4.8",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-pwa": "^0.14.0",
"vite-plugin-static-copy": "^0.13.0",
"vite-plugin-stylelint": "^4.0.1",
"vitest": "^0.33.0",
"vite-plugin-static-copy": "^0.17.0",
"vite-plugin-stylelint": "^4.3.0",
"vitest": "^0.34.1",
"workbox-build": "^6.5.4",
"workbox-window": "^6.5.4"
},
Expand Down
36 changes: 17 additions & 19 deletions src/components/LoginForm/LoginForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@ vi.mock('../SocialButton/SocialButton.tsx', () => ({
},
}));

vi.mock('#src/stores/AccountController', async (importOriginal) => {
const mod = await importOriginal();

return {
...(mod as Record<string, unknown>),
getSocialLoginUrls: () =>
Promise.resolve([
{
twitter: 'https://staging-v2.inplayer.com/',
},
{
facebook: 'https://www.facebook.com/',
},
{
google: 'https://accounts.google.com/',
},
]),
};
});
vi.mock('#src/stores/AccountController', async () => ({
getSocialLoginUrls: vi.fn(() => [
{
twitter: 'https://staging-v2.inplayer.com/',
},
{
facebook: 'https://www.facebook.com/',
},
{
google: 'https://accounts.google.com/',
},
]),
}));

describe('<LoginForm>', () => {
beforeEach(() => {
vi.useFakeTimers();
});

afterEach(() => {
vi.useRealTimers();
});

test('renders and matches snapshot', async () => {
const { container } = render(
<LoginForm
Expand Down
4 changes: 0 additions & 4 deletions src/components/Test/Test.module.scss

This file was deleted.

12 changes: 0 additions & 12 deletions src/components/Test/Test.test.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/Test/Test.tsx

This file was deleted.

6 changes: 2 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import path from 'path';
import fs from 'fs';

import { ConfigEnv, defineConfig, UserConfigExport } from 'vitest/config';
import { defineConfig } from 'vite';
import type { ConfigEnv, UserConfigExport } from 'vitest/config';
import react from '@vitejs/plugin-react';
import eslintPlugin from 'vite-plugin-eslint';
import StylelintPlugin from 'vite-plugin-stylelint';
Expand Down Expand Up @@ -101,15 +102,12 @@ export default ({ mode, command }: ConfigEnv): UserConfigExport => {
) {
return 'react';
}

if (id.includes('/node_modules/@inplayer')) {
return 'inplayer';
}

if (id.includes('/node_modules/')) {
return 'vendor';
}

return 'index';
},
},
Expand Down
Loading

0 comments on commit debf4a3

Please sign in to comment.