Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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(); ```
- Loading branch information