Skip to content

Commit 68536fb

Browse files
authored
chore: update all deps (#513)
* chore: update all deps * chore: run kcd-scripts format * chore: fix lint issues
1 parent ecea19c commit 68536fb

File tree

8 files changed

+31
-22
lines changed

8 files changed

+31
-22
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ supported version.
3333
Relevant code or config
3434

3535
```javascript
36+
3637
```
3738

3839
What you did:

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@
3636
"test:debug": "kcd-scripts --inspect-brk test --runInBand",
3737
"test:update": "npm test -- --updateSnapshot --coverage",
3838
"validate": "kcd-scripts validate",
39-
"typecheck": "tsc --project typings"
39+
"typecheck": "kcd-scripts typecheck --build typings"
4040
},
4141
"dependencies": {
42-
"@babel/runtime": "^7.10.2"
42+
"@babel/runtime": "^7.12.5"
4343
},
4444
"devDependencies": {
45-
"@testing-library/dom": "^7.21.4",
46-
"@testing-library/jest-dom": "^5.11.1",
45+
"@testing-library/dom": "^7.28.1",
46+
"@testing-library/jest-dom": "^5.11.6",
4747
"@types/estree": "0.0.45",
4848
"is-ci": "^2.0.0",
4949
"jest-serializer-ansi": "^1.0.3",
50-
"kcd-scripts": "^6.2.3",
51-
"typescript": "^4.0.5"
50+
"kcd-scripts": "^7.5.1",
51+
"typescript": "^4.1.2"
5252
},
5353
"peerDependencies": {
5454
"@testing-library/dom": ">=7.21.4"

src/__tests__/clear.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ test('clears even on inputs that cannot (programmatically) have a selection', ()
8282
const {element: number} = setup('<input value="12" type="number" />')
8383
userEvent.clear(number)
8484
// jest-dom does funny stuff with toHaveValue on number inputs
85+
// eslint-disable-next-line jest-dom/prefer-to-have-value
8586
expect(number.value).toBe('')
8687
})
8788

src/__tests__/type.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ test('typing into a controlled input works', () => {
425425

426426
userEvent.type(element, '23')
427427

428-
expect(element.value).toBe('$23')
428+
expect(element).toHaveValue('$23')
429429
expect(getEventSnapshot()).toMatchInlineSnapshot(`
430430
Events fired on: input[value="$23"]
431431
@@ -461,7 +461,7 @@ test('typing in the middle of a controlled input works', () => {
461461

462462
userEvent.type(element, '1')
463463

464-
expect(element.value).toBe('$213')
464+
expect(element).toHaveValue('$213')
465465
expect(getEventSnapshot()).toMatchInlineSnapshot(`
466466
Events fired on: input[value="$213"]
467467
@@ -503,7 +503,7 @@ test('ignored {backspace} in controlled input', () => {
503503
expect(element.selectionEnd).toBe(element.value.length)
504504
userEvent.type(element, '4')
505505

506-
expect(element.value).toBe('$234')
506+
expect(element).toHaveValue('$234')
507507
// the backslash in the inline snapshot is to escape the $ before {CURSOR}
508508
expect(getEventSnapshot()).toMatchInlineSnapshot(`
509509
Events fired on: input[value="$234"]
@@ -1108,7 +1108,7 @@ test('can type into an input with type `time`', () => {
11081108
input[value="01:05"] - change
11091109
input[value="01:05"] - keyup: 5 (53)
11101110
`)
1111-
expect(element.value).toBe('01:05')
1111+
expect(element).toHaveValue('01:05')
11121112
})
11131113

11141114
test('can type into an input with type `time` without ":"', () => {
@@ -1149,7 +1149,7 @@ test('can type into an input with type `time` without ":"', () => {
11491149
input[value="01:05"] - change
11501150
input[value="01:05"] - keyup: 5 (53)
11511151
`)
1152-
expect(element.value).toBe('01:05')
1152+
expect(element).toHaveValue('01:05')
11531153
})
11541154

11551155
test('can type more a number higher than 60 minutes into an input `time` and they are converted into 59 minutes', () => {
@@ -1195,7 +1195,7 @@ test('can type more a number higher than 60 minutes into an input `time` and the
11951195
input[value="23:59"] - keyup: 0 (48)
11961196
`)
11971197

1198-
expect(element.value).toBe('23:59')
1198+
expect(element).toHaveValue('23:59')
11991199
})
12001200

12011201
test('can type letters into an input `time` and they are ignored', () => {
@@ -1256,7 +1256,7 @@ test('can type letters into an input `time` and they are ignored', () => {
12561256
input[value="16:36"] - keyup: d (100)
12571257
`)
12581258

1259-
expect(element.value).toBe('16:36')
1259+
expect(element).toHaveValue('16:36')
12601260
})
12611261

12621262
test('can type a digit bigger in the hours section, bigger than 2 and it shows the time correctly', () => {
@@ -1299,7 +1299,7 @@ test('can type a digit bigger in the hours section, bigger than 2 and it shows t
12991299
input[value="09:25"] - keyup: 5 (53)
13001300
`)
13011301

1302-
expect(element.value).toBe('09:25')
1302+
expect(element).toHaveValue('09:25')
13031303
})
13041304

13051305
test('can type two digits in the hours section, equals to 24 and it shows the hours as 23', () => {
@@ -1345,7 +1345,7 @@ test('can type two digits in the hours section, equals to 24 and it shows the ho
13451345
input[value="23:52"] - keyup: 2 (50)
13461346
`)
13471347

1348-
expect(element.value).toBe('23:52')
1348+
expect(element).toHaveValue('23:52')
13491349
})
13501350

13511351
test('can type two digits in the hours section, bigger than 24 and less than 30, and it shows the hours as 23', () => {
@@ -1391,7 +1391,7 @@ test('can type two digits in the hours section, bigger than 24 and less than 30,
13911391
input[value="23:52"] - keyup: 2 (50)
13921392
`)
13931393

1394-
expect(element.value).toBe('23:52')
1394+
expect(element).toHaveValue('23:52')
13951395
})
13961396

13971397
test('{arrowdown} fires keyup/keydown events', () => {

typings/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"parserOptions": {
3+
"project": "./typings/tsconfig.json"
4+
}
5+
}

typings/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ declare const userEvent: {
5757
element: TargetElement,
5858
text: string,
5959
userOpts?: T,
60+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
6061
) => T extends {delay: number} ? Promise<void> : void
6162
tab: (userOpts?: ITabUserOptions) => void
6263
paste: (

typings/test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import userEvent, {TargetElement} from '.'
33
declare const element: TargetElement
44
type NotVoid = string | number | boolean | object | null
55

6-
userEvent.type(element, 'foo', {delay: 1}) as Promise<void>
6+
userEvent.type(element, 'foo', {delay: 1}).then(
7+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
8+
function handleSucces(_nothing: void) {},
9+
function handleError(_error: Error) {},
10+
)
711
// @ts-expect-error No delay returns void
812
userEvent.type(element, 'foo') as NotVoid

typings/tsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"compilerOptions": {
3-
"lib": ["dom"],
4-
"noEmit": true,
5-
"strict": true
6-
}
2+
"extends": "../node_modules/kcd-scripts/shared-tsconfig.json",
3+
"include": ["."]
74
}

0 commit comments

Comments
 (0)