1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(quality) add typescript to jest tests

This commit is contained in:
Sylvain 2022-11-29 11:19:07 +01:00
parent b30701ba6f
commit 7a3ab98b10
6 changed files with 24 additions and 6 deletions

View File

@ -69,6 +69,9 @@
"plugins": ["jest"],
"env": {
"jest/globals": true
},
"parserOptions": {
"project": "./test/frontend/tsconfig.json"
}
}
],

View File

@ -1,11 +1,10 @@
import React from 'react';
import { AccountingCodesSettings } from 'components/accounting/accounting-codes-settings';
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
describe('AccountingCodesSettings', () => {
const onSuccess = jest.fn(message => {});
const onError = jest.fn(e => {});
const onSuccess = jest.fn();
const onError = jest.fn();
test('render AccountingCodesSettings', async () => {
render(<AccountingCodesSettings onError={onError} onSuccess={onSuccess} />);

View File

@ -1,4 +1,3 @@
import React from 'react';
import { AdvancedAccountingForm } from 'components/accounting/advanced-accounting-form';
import { render, waitFor, screen } from '@testing-library/react';
import '@testing-library/jest-dom';

View File

@ -1,4 +1,3 @@
import React from 'react';
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import { PlanForm } from 'components/plans/plan-form';

View File

@ -0,0 +1,13 @@
{
"references": [
{ "path": "../../" }
],
"include": ["components/**/*", "__fixtures__/**/*"],
"compilerOptions": {
"jsx": "react-jsx",
"target": "es2015",
"module": "ES2020",
"moduleResolution": "node",
"baseUrl": "../../app/frontend/src/javascript"
}
}

View File

@ -12,12 +12,17 @@
"noEmit": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"rootDir": "app/frontend/src/javascript"
},
"exclude": [
"**/*.spec.ts",
"node_modules",
"vendor",
"public"
"public",
"test/frontend/**/*"
],
"include": [
"app/frontend/src/javascript/**/*"
],
"compileOnSave": false
}