Skip to content

test: setup asset loading and mock inefficient bundling warning #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions config/jestsetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ import Adapter from 'enzyme-adapter-react-16';
import { createSerializer } from 'enzyme-to-json';
import ResizeObserver from 'resize-observer-polyfill';
import 'intersection-observer';
import '@ui5/webcomponents/dist/generated/json-imports/i18n';
import 'whatwg-fetch';
import '@testing-library/jest-dom';

beforeAll(async () => {
await import('@ui5/webcomponents/dist/Assets');
await import('@ui5/webcomponents-fiori/dist/Assets');
await import('@ui5/webcomponents-react/dist/Assets');
});

jest.spyOn(global.console, 'warn').mockImplementation((message, ...rest) => {
if (!message.startsWith('Inefficient bundling detected')) {
console.error(message, ...rest);
}
});

// React 16 Enzyme adapter
Enzyme.configure({ adapter: new Adapter() });

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@
"targz": "^1.0.1",
"tmp": "^0.1.0",
"tslint": "^6.1.2",
"typescript": "^3.8.3",
"whatwg-fetch": "^3.0.0"
"typescript": "^3.8.3"
},
"resolutions": {
"@types/react": "16.9.34",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ Array [
</div>
<ui5-datepicker
primary-calendar-type="Gregorian"
value=""
value-state="None"
/>
</div>
Expand Down