Question: I think a Guid is generally the preferred unique table row identifier from a dba perspective. But I'm working on a project where the developers and managers appear to want a way to reference things by an int value. I can understand their perspective b/c they want a simple and easy way to reference different entities.

I was thinking about using a pattern for my tables where each table would have an int Id column representing the PK column but then it would also include a Guid column as a globally unique identifier. How common is it to use this type of pattern?

Answer: 
There is two ways to achieve this. One is using the `Config` option, as mentioned by @Aldarund. You can read about it [here](https://vue-test-utils.vuejs.org/api/#config).

If you are using Jest, I recommend doing this in the `jest.init.js` file:

```
import { config } from '@vue/test-utils'

config.mocks['$apiUrls'] = {
  'some/endpoint'
}

```

Then add this to the `jest` section of your `package.json`:

```
"setupFiles": [
  "<rootDir>/jest.init.js"
]

```

Now it is globally mocked. If you want to do this on a per test basis, you can use the `mocks` mounting option:

```
const wrapper = shallowMount(Foo, {
  mocks: {
    $apiUrls: 'some/endpoint'
  }
})

```

Hopefully this helps!

If you are interested I am compiling a collection of simple guides on how to test Vue components [here](https://github.com/lmiller1990/vue-testing-handbook). It's under development, but feel free to ask make an issue if you need help with other related things to testing Vue components.
I don't think the answers above work anymore (in 2020).

Here's what worked for me:

For vue-test-utils 1.x.x (Vue 2)
--------------------------------

1. Create a new file, name it eg. `jest.init.js`
2. Give it the following content:

```js
import { config } from "@vue/test-utils";
config.mocks["yourGlobalProperty"] = label => label; //you can replace it with your own mock

```

3. Add this to your `jest.config.js` (actually write "rootDir", don't replace anything with a real path)

```js
module.exports = {
  setupFiles: ["<rootDir>/jest.init.js"]
}

```

These files will be only ran before jest runs unit tests.

Note that I'm importing `{config}`, not the default export. I don't know why the default didn't work for me. [Even the documentation for vue test utils doesn't import the default export anymore](https://vue-test-utils.vuejs.org/api/#config)

Also make sure you're not trying to import from the old `vue-test-utils` package. (The new one is `@vue/test-utils`)

### For @vue/test-utils 2.x.x (vue-test-utils-next) (Vue 3)

Follow steps like for 1.x.x above, but in step two, do this instead:

```
import { config } from "@vue/test-utils"; //2.0.0-beta.5
config.global.mocks = {
  yourGlobalProperty: label => label
};

```