Skip to content

Commit 7302e05

Browse files
38elementseddyerburgh
authored andcommitted
refactor: silentWarnings to silent (#727)
1 parent 8011846 commit 7302e05

File tree

8 files changed

+17
-11
lines changed

8 files changed

+17
-11
lines changed

Diff for: docs/api/config.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ import VueTestUtils from '@vue/test-utils'
9595
VueTestUtils.config.logModifiedComponents = false
9696
```
9797

98-
### `silentWarnings`
98+
### `silent`
9999

100100
- type: `Boolean`
101101
- default: `true`
@@ -106,5 +106,5 @@ Example:
106106
```js
107107
import VueTestUtils from '@vue/test-utils'
108108

109-
VueTestUtils.config.silentWarnings = false
109+
VueTestUtils.config.silent = false
110110
```

Diff for: packages/server-test-utils/types/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ interface VueTestUtilsConfigOptions {
5151
methods?: Record<string, Function>
5252
provide?: object,
5353
logModifiedComponents?: Boolean
54+
silent?: Boolean
5455
}
5556

5657
export declare let config: VueTestUtilsConfigOptions

Diff for: packages/server-test-utils/types/test/renderToString.ts

+2
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ config.methods = {
6262
config.provide = {
6363
foo: {}
6464
}
65+
config.logModifiedComponents = true
66+
config.silent = true

Diff for: packages/test-utils/src/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export default {
1010
methods: {},
1111
provide: {},
1212
logModifiedComponents: true,
13-
silentWarnings: true
13+
silent: true
1414
}

Diff for: packages/test-utils/src/wrapper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export default class Wrapper implements BaseWrapper {
612612
*/
613613
setProps (data: Object) {
614614
const originalConfig = Vue.config.silent
615-
Vue.config.silent = config.silentWarnings
615+
Vue.config.silent = config.silent
616616
if (this.isFunctionalComponent) {
617617
throwError(
618618
`wrapper.setProps() cannot be called on a ` +

Diff for: packages/test-utils/types/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ interface VueTestUtilsConfigOptions {
147147
methods?: Record<string, Function>
148148
provide?: object,
149149
logModifiedComponents?: Boolean
150+
silent?: Boolean
150151
}
151152

152153
export declare function createLocalVue (): typeof Vue

Diff for: packages/test-utils/types/test/mount.ts

+2
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ config.methods = {
9292
config.provide = {
9393
foo: {}
9494
}
95+
config.logModifiedComponents = true
96+
config.silent = true

Diff for: test/specs/config.spec.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import {
1010
import Vue from 'vue'
1111

1212
describeWithShallowAndMount('config', mountingMethod => {
13-
let configStubsSave, consoleError, configLogSave, configSilentWarningsSave
13+
let configStubsSave, consoleError, configLogSave, configSilentSave
1414

1515
beforeEach(() => {
1616
TransitionGroupStub.name = 'another-temp-name'
1717
TransitionStub.name = 'a-temp-name'
1818
configStubsSave = config.stubs
1919
configLogSave = config.logModifiedComponents
20-
configSilentWarningsSave = config.silentWarnings
20+
configSilentSave = config.silent
2121
consoleError = sinon.stub(console, 'error')
2222
})
2323

@@ -26,7 +26,7 @@ describeWithShallowAndMount('config', mountingMethod => {
2626
TransitionStub.name = 'transition'
2727
config.stubs = configStubsSave
2828
config.logModifiedComponents = configLogSave
29-
config.silentWarnings = configSilentWarningsSave
29+
config.silent = configSilentSave
3030
consoleError.restore()
3131
})
3232

@@ -141,8 +141,8 @@ describeWithShallowAndMount('config', mountingMethod => {
141141
expect(wrapper.contains(TransitionStub)).to.equal(false)
142142
})
143143

144-
it("doesn't throw Vue warning when silentWarnings is set to true", () => {
145-
config.silentWarnings = true
144+
it("doesn't throw Vue warning when silent is set to true", () => {
145+
config.silent = true
146146
const localVue = createLocalVue()
147147
const wrapper = mountingMethod(ComponentWithProps, {
148148
propsData: {
@@ -157,8 +157,8 @@ describeWithShallowAndMount('config', mountingMethod => {
157157
expect(consoleError.called).to.equal(false)
158158
})
159159

160-
it('does throw Vue warning when silentWarnings is set to false', () => {
161-
config.silentWarnings = false
160+
it('does throw Vue warning when silent is set to false', () => {
161+
config.silent = false
162162
const localVue = createLocalVue()
163163
const wrapper = mountingMethod(ComponentWithProps, {
164164
propsData: {

0 commit comments

Comments
 (0)