Skip to content

Commit cc07d23

Browse files
committed
Bump deps and fix build
1 parent ad510b2 commit cc07d23

File tree

4 files changed

+40
-19
lines changed

4 files changed

+40
-19
lines changed

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
module.exports = {
2+
parserOptions: {
3+
parser: '@typescript-eslint/parser',
4+
},
25
extends: [
36
'./node_modules/kcd-scripts/eslint.js',
47
'plugin:vue/recommended',

package.json

+9-7
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,25 @@
4343
"author": "Daniel Cook",
4444
"license": "MIT",
4545
"dependencies": {
46-
"@babel/runtime": "^7.11.2",
47-
"@testing-library/dom": "^7.24.3",
46+
"@babel/runtime": "^7.12.5",
47+
"@testing-library/dom": "^7.26.6",
4848
"@vue/test-utils": "^1.1.0"
4949
},
5050
"devDependencies": {
5151
"@babel/plugin-transform-runtime": "^7.11.5",
52-
"@testing-library/jest-dom": "^5.11.4",
52+
"@testing-library/jest-dom": "^5.11.6",
53+
"@types/estree": "0.0.45",
5354
"apollo-boost": "^0.4.9",
5455
"apollo-cache-inmemory": "^1.6.6",
5556
"axios": "^0.20.0",
56-
"dtslint": "^4.0.4",
57+
"dtslint": "^4.0.5",
58+
"eslint": "^7.13.0",
5759
"eslint-plugin-vue": "^6.2.2",
5860
"graphql": "^15.3.0",
5961
"graphql-tag": "^2.11.0",
6062
"isomorphic-unfetch": "^3.0.0",
6163
"jest-serializer-vue": "^2.0.2",
62-
"kcd-scripts": "^6.5.1",
64+
"kcd-scripts": "^7.0.3",
6365
"lodash.merge": "^4.6.2",
6466
"msw": "^0.21.2",
6567
"portal-vue": "^2.1.7",
@@ -69,9 +71,9 @@
6971
"vue-apollo": "^3.0.4",
7072
"vue-i18n": "^8.21.1",
7173
"vue-jest": "^4.0.0-rc.0",
72-
"vue-router": "^3.4.5",
74+
"vue-router": "^3.4.9",
7375
"vue-template-compiler": "^2.6.12",
74-
"vuetify": "^2.3.10",
76+
"vuetify": "^2.3.17",
7577
"vuex": "^3.5.1"
7678
},
7779
"peerDependencies": {

types/index.d.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// TypeScript Version: 3.8
1+
// TypeScript Version: 4.0
22

33
import Vue, {ComponentOptions} from 'vue'
44
import {ThisTypedMountOptions, VueClass} from '@vue/test-utils'
55
import {Store, StoreOptions} from 'vuex'
66
import Router, {RouteConfig} from 'vue-router'
7+
// eslint-disable-next-line import/no-extraneous-dependencies
78
import {OptionsReceived as PrettyFormatOptions} from 'pretty-format'
89
import {queries, EventType, BoundFunctions} from '@testing-library/dom'
910

@@ -24,6 +25,7 @@ export interface RenderResult extends BoundFunctions<typeof queries> {
2425
unmount(): void
2526
isUnmounted(): boolean
2627
html(): string
28+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2729
emitted(): {[name: string]: any[][]}
2830
updateProps(props: object): Promise<void>
2931
}
@@ -40,6 +42,7 @@ export interface RenderOptions<V extends Vue, S = {}>
4042

4143
export type ConfigurationCallback<V extends Vue> = (
4244
localVue: typeof Vue,
45+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4346
store: Store<any>,
4447
router: Router,
4548
) => Partial<ThisTypedMountOptions<V>> | void

types/test.ts

+24-11
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ declare const elem: HTMLElement
66
const SomeComponent = Vue.extend({
77
name: 'SomeComponent',
88
props: {
9-
foo: Number,
10-
bar: String,
9+
foo: {type: Number, default: 0},
10+
bar: {type: String, default: '0'},
1111
},
1212
})
1313

14-
async function testRender() {
14+
export async function testRender() {
1515
const page = render({template: '<div />'})
1616

1717
// single queries
@@ -27,22 +27,26 @@ async function testRender() {
2727
// helpers
2828
const {container, unmount, debug} = page
2929

30+
debug(container)
31+
3032
debug(elem) // $ExpectType void
3133
debug([elem, elem], 100, {highlight: false}) // $ExpectType void
34+
35+
unmount()
3236
}
3337

34-
async function testRenderOptions() {
38+
export function testRenderOptions() {
3539
const container = document.createElement('div')
3640
const options = {container}
3741
render({template: 'div'}, options)
3842
}
3943

40-
async function testFireEvent() {
44+
export async function testFireEvent() {
4145
const {container} = render({template: 'button'})
4246
await fireEvent.click(container)
4347
}
4448

45-
async function testDebug() {
49+
export function testDebug() {
4650
const {debug, getAllByTestId} = render({
4751
render(h) {
4852
return h('div', [
@@ -55,19 +59,19 @@ async function testDebug() {
5559
debug(getAllByTestId('testid'))
5660
}
5761

58-
async function testScreen() {
62+
export async function testScreen() {
5963
render({template: 'button'})
6064

6165
await screen.findByRole('button')
6266
}
6367

64-
async function testWaitFor() {
68+
export async function testWaitFor() {
6569
const {container} = render({template: 'button'})
66-
fireEvent.click(container)
70+
await fireEvent.click(container)
6771
await waitFor(() => {})
6872
}
6973

70-
async function testOptions() {
74+
export function testOptions() {
7175
render(SomeComponent, {
7276
// options for new Vue()
7377
name: 'SomeComponent',
@@ -114,11 +118,20 @@ async function testOptions() {
114118
})
115119
}
116120

117-
function testConfigCallback() {
121+
export function testConfigCallback() {
118122
const ExamplePlugin: Vue.PluginFunction<never> = () => {}
119123
render(SomeComponent, {}, (localVue, store, router) => {
120124
localVue.use(ExamplePlugin)
121125
store.replaceState({foo: 'bar'})
122126
router.onError(error => console.log(error.message))
123127
})
124128
}
129+
130+
/*
131+
eslint
132+
testing-library/prefer-explicit-assert: "off",
133+
testing-library/no-wait-for-empty-callback: "off",
134+
testing-library/no-debug: "off",
135+
testing-library/prefer-screen-queries: "off",
136+
@typescript-eslint/unbound-method: "off",
137+
*/

0 commit comments

Comments
 (0)