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:
parent
b30701ba6f
commit
7a3ab98b10
@ -69,6 +69,9 @@
|
||||
"plugins": ["jest"],
|
||||
"env": {
|
||||
"jest/globals": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"project": "./test/frontend/tsconfig.json"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -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} />);
|
@ -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';
|
@ -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';
|
13
test/frontend/tsconfig.json
Normal file
13
test/frontend/tsconfig.json
Normal 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"
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user