Skip to content
This repository was archived by the owner on Mar 21, 2020. It is now read-only.

Commit 938cf3b

Browse files
committed
test: stub matchMedia
1 parent 75bb64d commit 938cf3b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/unit/jest.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path');
22

33
module.exports = {
4+
testURL: 'http://localhost',
45
rootDir: path.resolve(__dirname, '../../'),
56
moduleFileExtensions: [
67
'js',

test/unit/setup.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import Vue from 'vue';
22

33
Vue.config.productionTip = false;
44

5-
global.jsdom.reconfigure({
6-
url: 'http://localhost',
7-
});
5+
// polyfill matchMedia
6+
window.matchMedia = window.matchMedia ||
7+
(() => ({
8+
matches: false,
9+
addListener: () => {},
10+
removeListener: () => {},
11+
}));

0 commit comments

Comments
 (0)