Skip to content

Commit 697198f

Browse files
committed
chore: upgrade to Jest 27
1 parent 0e34a35 commit 697198f

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"jest-environment-jsdom-sixteen": "^1.0.3",
4646
"jest-watch-select-projects": "^2.0.0",
4747
"jsdom": "^16.2.1",
48-
"kcd-scripts": "^5.6.0",
48+
"kcd-scripts": "^11.1.0",
4949
"pretty-format": "^25.1.0"
5050
},
5151
"eslintConfig": {

src/__tests__/to-contain-html.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ describe('.toContainHTML', () => {
102102
}
103103

104104
expect(errorMessage).toMatchInlineSnapshot(`
105-
"<dim>expect(</><red>element</><dim>).toContainHTML()</>
106-
Expected:
107-
<green><div> non-existant element </div></>
108-
Received:
109-
<red><span data-testid=\\"child\\" /></>"
110-
`)
105+
<dim>expect(</><red>element</><dim>).toContainHTML()</>
106+
Expected:
107+
<green><div> non-existant element </div></>
108+
Received:
109+
<red><span data-testid="child" /></>
110+
`)
111111
})
112112
})

src/__tests__/to-have-display-value.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ test('it should throw if element is not valid', () => {
129129
}
130130

131131
expect(errorMessage).toMatchInlineSnapshot(
132-
`".toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead."`,
132+
`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`,
133133
)
134134

135135
try {
@@ -139,7 +139,7 @@ test('it should throw if element is not valid', () => {
139139
}
140140

141141
expect(errorMessage).toMatchInlineSnapshot(
142-
`".toHaveDisplayValue() currently does not support input[type=\\"radio\\"], try with another matcher instead."`,
142+
`.toHaveDisplayValue() currently does not support input[type="radio"], try with another matcher instead.`,
143143
)
144144

145145
try {
@@ -149,7 +149,7 @@ test('it should throw if element is not valid', () => {
149149
}
150150

151151
expect(errorMessage).toMatchInlineSnapshot(
152-
`".toHaveDisplayValue() currently does not support input[type=\\"checkbox\\"], try with another matcher instead."`,
152+
`.toHaveDisplayValue() currently does not support input[type="checkbox"], try with another matcher instead.`,
153153
)
154154
})
155155

src/__tests__/to-have-value.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ describe('.toHaveValue', () => {
115115
}
116116

117117
expect(errorMessage).toMatchInlineSnapshot(`
118-
"<dim>expect(</><red>element</><dim>).toHaveValue(</><green>something else</><dim>)</>
118+
<dim>expect(</><red>element</><dim>).toHaveValue(</><green>something else</><dim>)</>
119119
120-
Expected the element to have value:
121-
<green> something else</>
122-
Received:
123-
<red> foo</>"
124-
`)
120+
Expected the element to have value:
121+
<green> something else</>
122+
Received:
123+
<red> foo</>
124+
`)
125125
})
126126

127127
test('throws with type information when the expected text input value has loose equality with received value', () => {
@@ -135,13 +135,13 @@ describe('.toHaveValue', () => {
135135
}
136136

137137
expect(errorMessage).toMatchInlineSnapshot(`
138-
"<dim>expect(</><red>element</><dim>).toHaveValue(</><green>8</><dim>)</>
138+
<dim>expect(</><red>element</><dim>).toHaveValue(</><green>8</><dim>)</>
139139
140-
Expected the element to have value:
141-
<green> 8 (number)</>
142-
Received:
143-
<red> 8 (string)</>"
144-
`)
140+
Expected the element to have value:
141+
<green> 8 (number)</>
142+
Received:
143+
<red> 8 (string)</>
144+
`)
145145
})
146146

147147
test('throws when using not but the expected input value does match', () => {
@@ -155,13 +155,13 @@ describe('.toHaveValue', () => {
155155
errorMessage = error.message
156156
}
157157
expect(errorMessage).toMatchInlineSnapshot(`
158-
"<dim>expect(</><red>element</><dim>).not.toHaveValue(</><green>foo</><dim>)</>
158+
<dim>expect(</><red>element</><dim>).not.toHaveValue(</><green>foo</><dim>)</>
159159
160-
Expected the element not to have value:
161-
<green> foo</>
162-
Received:
163-
<red> foo</>"
164-
`)
160+
Expected the element not to have value:
161+
<green> foo</>
162+
Received:
163+
<red> foo</>
164+
`)
165165
})
166166

167167
test('throws when the form has no a value but a value is expected', () => {
@@ -175,13 +175,13 @@ describe('.toHaveValue', () => {
175175
errorMessage = error.message
176176
}
177177
expect(errorMessage).toMatchInlineSnapshot(`
178-
"<dim>expect(</><red>element</><dim>).toHaveValue(</><green>expected</><dim>)</>
178+
<dim>expect(</><red>element</><dim>).toHaveValue(</><green>expected</><dim>)</>
179179
180-
Expected the element to have value:
181-
<green> (any)</>
182-
Received:
183-
"
184-
`)
180+
Expected the element to have value:
181+
<green> (any)</>
182+
Received:
183+
184+
`)
185185
})
186186

187187
test('throws when the form has a value but none is expected', () => {
@@ -195,12 +195,12 @@ describe('.toHaveValue', () => {
195195
errorMessage = error.message
196196
}
197197
expect(errorMessage).toMatchInlineSnapshot(`
198-
"<dim>expect(</><red>element</><dim>).not.toHaveValue(</><green>expected</><dim>)</>
198+
<dim>expect(</><red>element</><dim>).not.toHaveValue(</><green>expected</><dim>)</>
199199
200-
Expected the element not to have value:
201-
<green> (any)</>
202-
Received:
203-
<red> foo</>"
204-
`)
200+
Expected the element not to have value:
201+
<green> (any)</>
202+
Received:
203+
<red> foo</>
204+
`)
205205
})
206206
})

0 commit comments

Comments
 (0)