Commit a249065
authored
Remove type condition (#1558)
In cases where the empty object is already set as default in the config:
See: `stubs`, `mocks` and `methods`
https://github.com/vuejs/vue-test-utils/blob/dev/packages/test-utils/src/config.js
The ? is not necessary. In this case, we can import the config and we will not be forced to check the existence of attributes:
```
import { config } from '@vue/test-utils';
if (config.mocks) {
config.mocks.i18n = { t: jest.fn() };
config.mocks.$t = jest.fn();
}
```
and use directly
```
import { config } from '@vue/test-utils';
config.mocks.i18n = { t: jest.fn() };
config.mocks.$t = jest.fn();
```1 parent 2858f24 commit a249065
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
0 commit comments