Skip to content
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

ci: add console errors to smoke tests #705

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .playground/index.tsx
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
* under the License.
*/

import 'core-js';
// import 'core-js';
import React from 'react';
import ReactDOM from 'react-dom';

19 changes: 19 additions & 0 deletions browsers/browsers.test.ts
Original file line number Diff line number Diff line change
@@ -56,10 +56,29 @@ describe('smoke tests', () => {
}
if (capabilities) {
driver = await new webdriver.Builder().withCapabilities(capabilities).build();

await driver.executeScript(() => {
// @ts-ignore
window.browserErrors = [];

window.console.error = (...args: any[]) => {
// @ts-ignore
window.browserErrors.push(...args);
};
});
}
});

afterAll(async() => {
const errors = await driver.executeScript(() =>
// @ts-ignore
JSON.stringify(window.browserErrors)
// if (entry.level.name === 'error') {
// console.log('[%s] %s', entry.level.name, entry.message);
// }
);
console.log('ERRRORS CLIENT', JSON.stringify(errors));

await driver.quit();
});

3 changes: 3 additions & 0 deletions src/components/chart.tsx
Original file line number Diff line number Diff line change
@@ -68,6 +68,9 @@ export class Chart extends React.Component<ChartProps, ChartState> {
this.chartContainerRef = createRef();
this.chartStageRef = createRef();

// eslint-disable-next-line no-console
console.error('this thing errored');

const id = props.id ?? uuid.v4();
const storeReducer = chartStoreReducer(id);
const enhancers = typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__