Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit 41f4232

Browse files
committed
hey hey
1 parent 9a68e68 commit 41f4232

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
/.quasar
66
/node_modules
77
/storybook-static
8+
/docs/_book
9+
/docs/node_modules
10+
/docs/book

jest.config.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
const esModules = ['quasar', 'quasar/lang', 'lodash-es', 'leaflet'].join('|');
1+
const esModules = ['quasar', 'quasar/lang', 'lodash-es', 'leaflet'].join('|')
22

33
module.exports = {
44
roots: [
5-
"<rootDir>/src/"
5+
'<rootDir>/src/',
66
],
77
globals: {
88
__DEV__: true,
99
},
1010
testEnvironment: 'jsdom',
11-
"testEnvironmentOptions": {
12-
"pretendToBeVisual": true
11+
testEnvironmentOptions: {
12+
pretendToBeVisual: true,
1313
},
1414
collectCoverage: true,
1515
coverageDirectory: './coverage/',
1616
coverageReporters: [
17-
"json",
18-
"lcov"
17+
'json',
18+
'lcov',
1919
],
2020
// Needed in JS codebases too because of feature flags
2121
coveragePathIgnorePatterns: ['/node_modules/', '.d.ts$'],
2222
testMatch: [
2323
'<rootDir>/src/**/*.spec.js',
2424
],
2525
moduleDirectories: [
26-
"node_modules",
27-
"<rootDir>/src",
26+
'node_modules',
27+
'<rootDir>/src',
2828
],
2929
moduleFileExtensions: ['vue', 'js', 'json'],
3030
moduleNameMapper: {
3131
'^quasar$': 'quasar/dist/quasar.esm.prod.js',
32-
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/fileMock.js",
33-
"\\.(css|less|styl|stylus|sass|scss)$": "<rootDir>/test/styleMock.js",
34-
"@/(.*)$": "<rootDir>/src/$1",
35-
">/(.*)$": "<rootDir>/test/$1",
36-
//'^vue$': '@vue/compat', TODO remove
32+
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/test/fileMock.js',
33+
'\\.(css|less|styl|stylus|sass|scss)$': '<rootDir>/test/styleMock.js',
34+
'@/(.*)$': '<rootDir>/src/$1',
35+
'>/(.*)$': '<rootDir>/test/$1',
3736
},
3837
transform: {
3938
'.*\\.vue$': '@vue/vue3-jest',
@@ -43,12 +42,12 @@ module.exports = {
4342
transformIgnorePatterns: [`node_modules/(?!(${esModules}))`],
4443
snapshotSerializers: ['jest-serializer-vue'],
4544
setupFiles: [
46-
"<rootDir>/test/setup/env.js",
47-
"<rootDir>/test/setup/unhandledPromiseRejectionHandler.js",
48-
"<rootDir>/test/setup/mockRandom.js",
49-
"<rootDir>/test/setup/mockScroll.js",
50-
"<rootDir>/test/setup/mockUserAgent.js",
51-
"<rootDir>/test/setup/mockLocation.js",
52-
"jest-canvas-mock"
45+
'<rootDir>/test/setup/env.js',
46+
'<rootDir>/test/setup/unhandledPromiseRejectionHandler.js',
47+
'<rootDir>/test/setup/mockRandom.js',
48+
'<rootDir>/test/setup/mockScroll.js',
49+
'<rootDir>/test/setup/mockUserAgent.js',
50+
'<rootDir>/test/setup/mockLocation.js',
51+
'jest-canvas-mock',
5352
],
54-
};
53+
}

jsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dist",
1616
".quasar",
1717
"node_modules",
18-
"storybook-static"
18+
"storybook-static",
19+
"docs/_book"
1920
]
2021
}

src/storyshots.spec.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ jest.mock('@storybook/vue3', () => ({
2424
import glob from 'glob'
2525
import lolex from 'lolex'
2626
import { createRenderer } from 'vue-server-renderer'
27-
import Vue from 'vue'
2827
import { Quasar } from 'quasar'
2928
import quasarConfig from '>/quasarConfig'
3029
import { mount, RouterLinkStub } from '@vue/test-utils'
3130
import i18n from '@/base/i18n'
3231
import routerMocks from '>/routerMocks'
3332

3433
i18n.locale = 'en'
35-
Vue.component('RouterLink', RouterLinkStub)
36-
Vue.directive('measure', {})
3734

3835
// To get properly faked dates, install fake Date object before importing stories
3936
const now = new Date('2017-12-24T12:00:00Z')
@@ -94,8 +91,19 @@ for (const group of mockStories) {
9491
const component = story.render()
9592

9693
const wrapper = mount(component, {
97-
mocks: {
98-
...routerMocks,
94+
global: {
95+
plugins: [
96+
[Quasar, quasarConfig],
97+
],
98+
stubs: {
99+
RouterLink: RouterLinkStub,
100+
},
101+
directives: {
102+
measure: {},
103+
},
104+
mocks: {
105+
...routerMocks,
106+
},
99107
},
100108
})
101109
const html = await renderer.renderToString(wrapper.vm)

0 commit comments

Comments
 (0)