Skip to content

Commit

Permalink
Corrigir warnings do jest (#209)
Browse files Browse the repository at this point in the history
* refactor: fixed jest config

fix #193

* refactor: fixed imports

re #193
  • Loading branch information
PiluVitu authored Nov 21, 2023
1 parent 9465c76 commit 3e08cf8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
27 changes: 22 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/tests-examples/**/*.spec.ts'],
roots: ['<rootDir>'],
module.exports = async () => {
return {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/tests-examples/**/*.spec.ts'],
roots: ['<rootDir>'],
moduleNameMapper: {
'^~config(.*)$': '<rootDir>/src/config$1',
'^~pages(.*)$': '<rootDir>/src/pages$1',
'^~components(.*)$': '<rootDir>/src/components$1',
'^~styles(.*)$': '<rootDir>/src/styles$1',
'^~store(.*)$': '<rootDir>/src/store$1',
'^~snippets(.*)$': '<rootDir>/src/snippets$1',
'^~interfaces(.*)$': '<rootDir>/src/interfaces$1',
'^~services(.*)$': '<rootDir>/src/services$1',
'^~constants(.*)$': '<rootDir>/src/constants$1',
'^~utils(.*)$': '<rootDir>/src/utils$1',
'^~hooks(.*)$': '<rootDir>/src/hooks$1',
'^~types(.*)$': '<rootDir>/src/types$1',
'^~enums(.*)$': '<rootDir>/src/enums$1',
},
};
};
17 changes: 0 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"jest": {
"moduleNameMapper": {
"^~config(.*)$": "<rootDir>/src/config$1",
"^~pages(.*)$": "<rootDir>/src/pages$1",
"^~components(.*)$": "<rootDir>/src/components$1",
"^~styles(.*)$": "<rootDir>/src/styles$1",
"^~store(.*)$": "<rootDir>/src/store$1",
"^~snippets(.*)$": "<rootDir>/src/snippets$1",
"^~interfaces(.*)$": "<rootDir>/src/interfaces$1",
"^~services(.*)$": "<rootDir>/src/services$1",
"^~constants(.*)$": "<rootDir>/src/constants$1",
"^~utils(.*)$": "<rootDir>/src/utils$1",
"^~hooks(.*)$": "<rootDir>/src/hooks$1",
"^~types(.*)$": "<rootDir>/src/types$1",
"^~enums(.*)$": "<rootDir>/src/enums$1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function CharacterLimitMainText(props: ICharacterLimitMainTextProps) {
<div className={scss.compost}>
{props.module.map((module) => (
<CharacterLimit
key={module.id}
maxLength={module.maxLength}
value={module.value}
id={module.id}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ComposerEditor/ComposerEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { useState } from 'react';

import CharacterLimitMainText from '~components/CharacterLimitMainText/CharacterLimitMainText'; // Importe o componente CharacterLimitMainText aqui
import CustomTextArea from '~components/TextArea/TextArea'; // Importe o componente CustomTextArea aqui
import CharacterLimitMainText from '../CharacterLimitMainText/CharacterLimitMainText'; // Importe o componente CharacterLimitMainText aqui
import CustomTextArea from '../TextArea/TextArea'; // Importe o componente CustomTextArea aqui

import scss from './ComposerEditor.module.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useState } from 'react';

import Accordion from '~components/Accordion/Accordion';
import ToggleSocialMedia from '~components/ToggleSocialMedia/ToggleSocialMedia';

import scss from './SocialAccordion.module.scss';

import iconPlaceholderForIcon from './assets/facebook.svg';

import Accordion from '../../../../../../components/Accordion/Accordion';
import ToggleSocialMedia from '../../../../../../components/ToggleSocialMedia/ToggleSocialMedia';
import { ISocialAccordion } from './SocialAccordion.type';

function SocialAccordion(props: ISocialAccordion) {
Expand Down

0 comments on commit 3e08cf8

Please sign in to comment.