Skip to content

Commit d523604

Browse files
committed
test: mock date
1 parent 711670e commit d523604

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/shared/demoTest.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import { mount } from '@vue/test-utils';
33
import MockDate from 'mockdate';
44
import dayjs from 'dayjs';
55
import antd from 'ant-design-vue';
6-
import utc from 'dayjs/plugin/utc';
76
import { sleep } from '../utils';
87

9-
dayjs.extend(utc);
108
export default function demoTest(component, options = {}) {
119
const suffix = options.suffix || 'vue';
1210
const files = glob.sync(`./components/${component}/demo/*.${suffix}`);
@@ -20,7 +18,7 @@ export default function demoTest(component, options = {}) {
2018
testMethod = test.skip;
2119
}
2220
testMethod(`renders ${file} correctly`, async () => {
23-
MockDate.set(dayjs.utc('2016-11-22').valueOf());
21+
MockDate.set(dayjs('2016-11-22T00:00:00Z').valueOf());
2422
const demo = require(`../.${file}`).default || require(`../.${file}`);
2523
document.body.innerHTML = '';
2624
const wrapper = mount(demo, { global: { plugins: [antd] }, attachTo: document.body });

0 commit comments

Comments
 (0)