Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated test config files #474

Merged
merged 3 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ vitest.config.ts
playwright.config.ts

src/api
src/config

**/*.json
**/*.md
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
},
{
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
excludedFiles: ['*.test.*', '*.stories.*'],
excludedFiles: ['*.test.*', '*.stories.*', './src/providers/AuthProvider/**', '.src/utils/auth_environment.ts'],
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
}
Expand Down
2 changes: 1 addition & 1 deletion config/config_files/test-utils/mockLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { vi } from 'vitest';

// Mock localStorage
const localStorageMock = (function () {
let store: any = {};
let store: Record<string, string> = {};

return {
getItem(key: string) {
Expand Down
14 changes: 14 additions & 0 deletions config/config_files/test-utils/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ReactElement } from 'react';

import { render, RenderOptions } from '@testing-library/react';

import { Providers } from 'src/providers';

const customRender = (
ui: ReactElement,
options?: Omit<RenderOptions, 'wrapper'>
) => render(ui, { wrapper: Providers, ...options });

export * from '@testing-library/react';
export * from '@testing-library/user-event';
export { customRender as renderWithProviders };
mariush2 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions config/config_list.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/.eslintrc.js
https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/.eslintignore
https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/.prettierignore
https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/.prettierrc.js
https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/.lintstagedrc.yaml
Expand Down
5 changes: 5 additions & 0 deletions config/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ curl -s "https://raw.githubusercontent.com/equinor/amplify-components/main/confi
printf -- "Downloading mockLocalStorage.ts file...\n"

curl -s "https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/test-utils/mockLocalStorage.ts" > mockLocalStorage.ts

printf -- "Downloading utils.ts file...\n"

curl -s "https://raw.githubusercontent.com/equinor/amplify-components/main/config/config_files/test-utils/utils.ts" > utils.ts

cd ../..

printf -- "Downloading nginx.conf proxy config...\n"
Expand Down
Loading