From 58850bace0d21f350391a3694a1b5359c4e96068 Mon Sep 17 00:00:00 2001 From: eddyerburgh Date: Fri, 4 May 2018 21:08:00 +0100 Subject: [PATCH] test: skip renderToString tests --- test/specs/mounting-options/provide.spec.js | 40 ++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/test/specs/mounting-options/provide.spec.js b/test/specs/mounting-options/provide.spec.js index 9cbecb250..a46432047 100644 --- a/test/specs/mounting-options/provide.spec.js +++ b/test/specs/mounting-options/provide.spec.js @@ -3,7 +3,8 @@ import ComponentWithInject from '~resources/components/component-with-inject.vue import { injectSupported } from '~resources/utils' import { describeWithMountingMethods, - itDoNotRunIf + itDoNotRunIf, + itSkipIf } from '~resources/utils' describeWithMountingMethods('options.provide', (mountingMethod) => { @@ -57,16 +58,20 @@ describeWithMountingMethods('options.provide', (mountingMethod) => { expect(wrapper.vm.setInBeforeCreate).to.equal('created') }) - itDoNotRunIf(!injectSupported(), 'injects the provide from the config', () => { - config.provide['fromMount'] = 'globalConfig' + itSkipIf(mountingMethod.name === 'renderToString', + 'injects the provide from the config', () => { + if (!injectSupported()) { + return + } + config.provide['fromMount'] = 'globalConfig' - const wrapper = mountingMethod(ComponentWithInject) - const HTML = mountingMethod.name === 'renderToString' - ? wrapper - : wrapper.html() + const wrapper = mountingMethod(ComponentWithInject) + const HTML = mountingMethod.name === 'renderToString' + ? wrapper + : wrapper.html() - expect(HTML).to.contain('globalConfig') - }) + expect(HTML).to.contain('globalConfig') + }) itDoNotRunIf(!injectSupported(), 'prioritize mounting options over config', () => { config.provide['fromMount'] = 'globalConfig' @@ -81,13 +86,14 @@ describeWithMountingMethods('options.provide', (mountingMethod) => { expect(HTML).to.contain('_') }) - itDoNotRunIf(!injectSupported(), 'config with function throws', () => { - config.provide = () => {} + itSkipIf(mountingMethod.name === 'renderToString', + 'config with function throws', () => { + config.provide = () => {} - expect(() => { - mountingMethod(ComponentWithInject, { - provide: { fromMount: '_' } - }) - }).to.throw() - }) + expect(() => { + mountingMethod(ComponentWithInject, { + provide: { fromMount: '_' } + }) + }).to.throw() + }) })