Skip to content

Commit

Permalink
Fix tests after PF updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Aug 7, 2023
1 parent 885d548 commit 0f8c492
Show file tree
Hide file tree
Showing 88 changed files with 7,705 additions and 12,566 deletions.
8 changes: 7 additions & 1 deletion config/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
/* eslint-disable no-unused-vars */
import { configure } from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import Adapter from '@cfaester/enzyme-adapter-react-18';
import 'whatwg-fetch';
import 'babel-polyfill';
import '@testing-library/jest-dom';
import { expect } from '@jest/globals';
import * as matchers from '@testing-library/jest-dom/dist/matchers';

// ensure the expect is picked up from jest not cypress
global.expect = expect;
// extends with RTL
global.expect.extend(matchers);
configure({ adapter: new Adapter() });
global.SVGPathElement = function () {};

Expand Down
18 changes: 10 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
coverageDirectory: './coverage/',
collectCoverage: true,
transformIgnorePatterns: [
'node_modules/(?!@patternfly|@data-driven-forms|lodash-es|@openshift)',
'node_modules/(?!@data-driven-forms|lodash-es|@openshift|uuid)',

// Uncomment the below line if you face any errors with jest
// '/node_modules/(?!@redhat-cloud-services)',
Expand All @@ -32,16 +32,18 @@ const config = {
PFReactCore: '@patternfly/react-core',
PFReactTable: '@patternfly/react-table',
},
testURL: 'http://localhost:5000/',
testEnvironmentOptions: {
url: 'http://localhost:5000/',
},
globalSetup: '<rootDir>/config/globalSetup.js',
transform: {
'^.+\\.jsx?$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
},
globals: {
'ts-jest': {
tsconfig: './tsconfig.json',
},
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: './tsconfig.json',
},
],
},
};

Expand Down
Loading

0 comments on commit 0f8c492

Please sign in to comment.