Skip to content
Permalink
Browse files

test(unit): remove console.error logs

  • Loading branch information
ifiokjr committed Jan 9, 2020
1 parent d6a5a53 commit 74d1a65652d700c6db534683408d9ecc8f2cf481
Showing with 17 additions and 0 deletions.
  1. +1 −0 package.json
  2. +11 −0 src/jsonld/__tests__/jsonld.test.tsx
  3. +5 −0 yarn.lock
@@ -116,6 +116,7 @@
"jest-dev-server": "^4.4.0",
"jest-environment-puppeteer": "^4.4.0",
"jest-extended": "^0.11.2",
"jest-mock-console": "^1.0.0",
"jest-puppeteer": "^4.4.0",
"jest-watch-typeahead": "^0.4.2",
"lint-staged": "^9.5.0",
@@ -1,5 +1,6 @@
import { assertSchema } from '@cypress/schema-tools';
import { render as testRender } from '@testing-library/react';
import mockConsole, { RestoreConsole } from 'jest-mock-console';
import React, { ReactElement } from 'react';
import { HelmetProvider } from 'react-helmet-async';

@@ -20,6 +21,16 @@ import { SpeakableJsonLd } from '../speakable';

const render = (ui: ReactElement) => testRender(ui, { wrapper: HelmetProvider });

let restoreConsole: RestoreConsole;

beforeAll(() => {
restoreConsole = mockConsole('error');
});

afterAll(() => {
restoreConsole();
});

test('ArticleJsonLd', () => {
render(
<>
@@ -8276,6 +8276,11 @@ jest-message-util@^24.9.0:
slash "^2.0.0"
stack-utils "^1.0.1"

jest-mock-console@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/jest-mock-console/-/jest-mock-console-1.0.0.tgz#0ca2cbea3aa0af4893c8c5f3c2de45c3d4d15629"
integrity sha512-bN9UjH+Jd/5Gs+p9Xt9Mai4SoUQRFd3f+ZOSCjlcbuVRUhNvl1y9jvys6L7BUx+1Uz+3jOoaq1O+C6j3sSu7SQ==

jest-mock@^24, jest-mock@^24.9.0:
version "24.9.0"
resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6"

0 comments on commit 74d1a65

Please sign in to comment.
You can’t perform that action at this time.