Skip to content

Commit 1a4d12f

Browse files
authored
test: skip renderToString tests (#581)
1 parent d31c24c commit 1a4d12f

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

Diff for: test/specs/mounting-options/provide.spec.js

+23-17
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import ComponentWithInject from '~resources/components/component-with-inject.vue
33
import { injectSupported } from '~resources/utils'
44
import {
55
describeWithMountingMethods,
6-
itDoNotRunIf
6+
itDoNotRunIf,
7+
itSkipIf
78
} from '~resources/utils'
89

910
describeWithMountingMethods('options.provide', (mountingMethod) => {
@@ -57,16 +58,20 @@ describeWithMountingMethods('options.provide', (mountingMethod) => {
5758
expect(wrapper.vm.setInBeforeCreate).to.equal('created')
5859
})
5960

60-
itDoNotRunIf(!injectSupported(), 'injects the provide from the config', () => {
61-
config.provide['fromMount'] = 'globalConfig'
61+
itSkipIf(mountingMethod.name === 'renderToString',
62+
'injects the provide from the config', () => {
63+
if (!injectSupported()) {
64+
return
65+
}
66+
config.provide['fromMount'] = 'globalConfig'
6267

63-
const wrapper = mountingMethod(ComponentWithInject)
64-
const HTML = mountingMethod.name === 'renderToString'
65-
? wrapper
66-
: wrapper.html()
68+
const wrapper = mountingMethod(ComponentWithInject)
69+
const HTML = mountingMethod.name === 'renderToString'
70+
? wrapper
71+
: wrapper.html()
6772

68-
expect(HTML).to.contain('globalConfig')
69-
})
73+
expect(HTML).to.contain('globalConfig')
74+
})
7075

7176
itDoNotRunIf(!injectSupported(), 'prioritize mounting options over config', () => {
7277
config.provide['fromMount'] = 'globalConfig'
@@ -81,13 +86,14 @@ describeWithMountingMethods('options.provide', (mountingMethod) => {
8186
expect(HTML).to.contain('_')
8287
})
8388

84-
itDoNotRunIf(!injectSupported(), 'config with function throws', () => {
85-
config.provide = () => {}
89+
itSkipIf(mountingMethod.name === 'renderToString',
90+
'config with function throws', () => {
91+
config.provide = () => {}
8692

87-
expect(() => {
88-
mountingMethod(ComponentWithInject, {
89-
provide: { fromMount: '_' }
90-
})
91-
}).to.throw()
92-
})
93+
expect(() => {
94+
mountingMethod(ComponentWithInject, {
95+
provide: { fromMount: '_' }
96+
})
97+
}).to.throw()
98+
})
9399
})

0 commit comments

Comments
 (0)