From 4c06d9bb7dda671853c44a06c6ffefba0c720644 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 17 Sep 2019 19:56:15 +0200 Subject: [PATCH] test: fix for mocha --- __tests__/helper.js | 5 ++++- __tests__/ssr/basic.spec.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/__tests__/helper.js b/__tests__/helper.js index 1ba01ea9..ccb6fb06 100644 --- a/__tests__/helper.js +++ b/__tests__/helper.js @@ -13,7 +13,10 @@ if (typeof global !== 'undefined' && typeof global.beforeAll === 'undefined') { // monkey patch jest snapshots expect.extend({ toMatchInlineSnapshot(received, snapshot) { - const text = `[${received.toString()}]` + const text = + typeof received === 'string' + ? JSON.stringify(received) + : `[${received.toString()}]` const match = INITIAL_WS_RE.exec(snapshot) let expected = snapshot diff --git a/__tests__/ssr/basic.spec.js b/__tests__/ssr/basic.spec.js index a553485c..0d678e1d 100644 --- a/__tests__/ssr/basic.spec.js +++ b/__tests__/ssr/basic.spec.js @@ -1,3 +1,6 @@ +// @ts-check +require('../helper') +const expect = require('expect') const { renderApp, renderer } = require('./shared') describe('SSR: basicRenderer', () => { -- 2.47.3