Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1ebc117

Browse files
chore: upgrade to kcd-scripts 10 (#244)
1 parent b028364 commit 1ebc117

File tree

9 files changed

+27
-16
lines changed

9 files changed

+27
-16
lines changed

‎.eslintrc.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
extends: [
66
'./node_modules/kcd-scripts/eslint.js',
77
'plugin:vue/recommended',
8-
'prettier/vue',
8+
'prettier',
99
],
1010
plugins: ['vue'],
1111
rules: {
@@ -18,5 +18,7 @@ module.exports = {
1818
'testing-library/no-manual-cleanup': 'off',
1919
'testing-library/no-await-sync-events': 'off',
2020
'testing-library/await-fire-event': 'error',
21+
'testing-library/prefer-user-event': 'off',
22+
'testing-library/no-node-access': 'off',
2123
},
2224
}

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"graphql-tag": "^2.11.0",
6363
"isomorphic-unfetch": "^3.0.0",
6464
"jest-serializer-vue": "^2.0.2",
65-
"kcd-scripts": "^7.0.3",
65+
"kcd-scripts": "^10.1.1",
6666
"lodash.merge": "^4.6.2",
6767
"msw": "^0.26.2",
6868
"portal-vue": "^2.1.7",

‎src/__tests__/auto-cleanup.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ test('render the first component', () => {
1515
})
1616

1717
test('cleans up after each test by default', () => {
18-
expect(document.body.innerHTML).toMatchInlineSnapshot(`""`)
18+
expect(document.body.innerHTML).toMatchInlineSnapshot(``)
1919
})

‎src/__tests__/form-user-event.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-enable testing-library/prefer-user-event */
12
import '@testing-library/jest-dom'
23
import {render, waitFor} from '@testing-library/vue'
34
import userEvent from '@testing-library/user-event'

‎src/__tests__/select-user-event.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-enable testing-library/prefer-user-event */
12
import '@testing-library/jest-dom'
23
import {render} from '@testing-library/vue'
34
import userEvent from '@testing-library/user-event'

‎src/__tests__/vuetify.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test('renders a Vuetify-powered component', async () => {
4343

4444
expect(getByText('Lorem ipsum dolor sit amet.')).toMatchInlineSnapshot(`
4545
<div
46-
class="v-card__text"
46+
class=v-card__text
4747
>
4848
Lorem ipsum dolor sit amet.
4949
</div>

‎src/__tests__/within.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test('within() returns an object with all queries bound to the DOM node', () =>
2727
// Here, proof that there's only one match for the specified text.
2828
expect(divNode).toMatchInlineSnapshot(`
2929
<div
30-
data-testid="div"
30+
data-testid=div
3131
>
3232
repeated text
3333
</div>

‎src/fire-event.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable testing-library/no-wait-for-empty-callback */
1+
/* eslint-disable testing-library/no-wait-for-empty-callback, testing-library/await-fire-event */
22
import {waitFor, fireEvent as dtlFireEvent} from '@testing-library/dom'
33

44
// Vue Testing Lib's version of fireEvent will call DOM Testing Lib's

‎types/test.ts‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,27 @@ const SomeComponent = Vue.extend({
1414
})
1515

1616
export async function testRender() {
17-
const page = render({template: '<div />'})
17+
const {
18+
getByText,
19+
queryByText,
20+
findByText,
21+
getAllByText,
22+
queryAllByText,
23+
findAllByText,
24+
container,
25+
unmount,
26+
debug,
27+
} = render({template: '<div />'})
1828

1929
// single queries
20-
page.getByText('foo')
21-
page.queryByText('foo')
22-
await page.findByText('foo')
30+
getByText('foo')
31+
queryByText('foo')
32+
await findByText('foo')
2333

2434
// multiple queries
25-
page.getAllByText('bar')
26-
page.queryAllByText('bar')
27-
await page.findAllByText('bar')
28-
29-
// helpers
30-
const {container, unmount, debug} = page
35+
getAllByText('bar')
36+
queryAllByText('bar')
37+
await findAllByText('bar')
3138

3239
debug(container)
3340

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /