From: Eduardo San Martin Morote Date: Tue, 17 Sep 2019 17:56:15 +0000 (+0200) Subject: test: fix for mocha X-Git-Tag: v4.0.0-alpha.0~228^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c06d9bb7dda671853c44a06c6ffefba0c720644;p=thirdparty%2Fvuejs%2Frouter.git test: fix for mocha --- 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', () => {