mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-26 20:54:21 +01:00
(quality) add typescript to jest tests
This commit is contained in:
parent
b30701ba6f
commit
7a3ab98b10
@ -69,6 +69,9 @@
|
|||||||
"plugins": ["jest"],
|
"plugins": ["jest"],
|
||||||
"env": {
|
"env": {
|
||||||
"jest/globals": true
|
"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 { AccountingCodesSettings } from 'components/accounting/accounting-codes-settings';
|
||||||
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
|
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
|
|
||||||
describe('AccountingCodesSettings', () => {
|
describe('AccountingCodesSettings', () => {
|
||||||
const onSuccess = jest.fn(message => {});
|
const onSuccess = jest.fn();
|
||||||
const onError = jest.fn(e => {});
|
const onError = jest.fn();
|
||||||
|
|
||||||
test('render AccountingCodesSettings', async () => {
|
test('render AccountingCodesSettings', async () => {
|
||||||
render(<AccountingCodesSettings onError={onError} onSuccess={onSuccess} />);
|
render(<AccountingCodesSettings onError={onError} onSuccess={onSuccess} />);
|
@ -1,4 +1,3 @@
|
|||||||
import React from 'react';
|
|
||||||
import { AdvancedAccountingForm } from 'components/accounting/advanced-accounting-form';
|
import { AdvancedAccountingForm } from 'components/accounting/advanced-accounting-form';
|
||||||
import { render, waitFor, screen } from '@testing-library/react';
|
import { render, waitFor, screen } from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
@ -1,4 +1,3 @@
|
|||||||
import React from 'react';
|
|
||||||
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
|
import { render, fireEvent, waitFor, screen } from '@testing-library/react';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
import { PlanForm } from 'components/plans/plan-form';
|
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,
|
"noEmit": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
|
"rootDir": "app/frontend/src/javascript"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"vendor",
|
"vendor",
|
||||||
"public"
|
"public",
|
||||||
|
"test/frontend/**/*"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"app/frontend/src/javascript/**/*"
|
||||||
],
|
],
|
||||||
"compileOnSave": false
|
"compileOnSave": false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user