Skip to content

Commit d284ebe

Browse files
authored
chore: upgrade to Jest 27 (#293)
* chore: upgrade to Jest 27 * chore: format * chore: fix ESLint config * chore: upgrade kcd-scripts again
1 parent 551f130 commit d284ebe

File tree

5 files changed

+61
-66
lines changed

5 files changed

+61
-66
lines changed

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
],
88
"rules": {
99
"testing-library/no-dom-import": "off",
10-
"babel/new-cap": "off",
11-
"babel/quotes": "off"
10+
"@babel/new-cap": "off",
11+
"@babel/quotes": "off"
1212
}
1313
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"eslint": "^7.6.0",
3232
"eslint-config-prettier": "^8.1.0",
3333
"eslint-plugin-testcafe": "^0.2.1",
34-
"kcd-scripts": "^8.1.1",
34+
"kcd-scripts": "^11.2.0",
3535
"npm-run-all": "^4.1.5",
36-
"prettier": "^2.0.5",
36+
"prettier": "^2.3.2",
3737
"semantic-release": "^17.0.7",
3838
"testcafe": "^1.8.4",
39-
"ts-jest": "^26.0.0",
39+
"ts-jest": "^27.0.3",
4040
"typescript": "^4.0.2"
4141
},
4242
"repository": {

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export function configure(options: Partial<Options>) {
4545
}
4646

4747
const withWithinMethods = (selector: Selector) => {
48-
return (selector.addCustomMethods(withinSelectors, {
48+
return selector.addCustomMethods(withinSelectors, {
4949
returnDOMNodes: true,
50-
}) as unknown) as WithinSelectors;
50+
}) as unknown as WithinSelectors;
5151
};
5252
type SelectorArg =
5353
| string

tests/unit/__snapshots__/selectors.test.ts.snap

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,57 @@
22

33
exports[`exports expected exports 1`] = `
44
Array [
5-
"configureOnce",
6-
"configure",
7-
"within",
8-
"getByLabelText",
9-
"getAllByLabelText",
10-
"queryByLabelText",
11-
"queryAllByLabelText",
12-
"findByLabelText",
13-
"findAllByLabelText",
14-
"getByPlaceholderText",
15-
"getAllByPlaceholderText",
16-
"queryByPlaceholderText",
17-
"queryAllByPlaceholderText",
18-
"findByPlaceholderText",
19-
"findAllByPlaceholderText",
20-
"getByText",
21-
"getAllByText",
22-
"queryByText",
23-
"queryAllByText",
24-
"findByText",
25-
"findAllByText",
26-
"getByAltText",
27-
"getAllByAltText",
28-
"queryByAltText",
29-
"queryAllByAltText",
30-
"findByAltText",
31-
"findAllByAltText",
32-
"getByTitle",
33-
"getAllByTitle",
34-
"queryByTitle",
35-
"queryAllByTitle",
36-
"findByTitle",
37-
"findAllByTitle",
38-
"getByDisplayValue",
39-
"getAllByDisplayValue",
40-
"queryByDisplayValue",
41-
"queryAllByDisplayValue",
42-
"findByDisplayValue",
43-
"getByRole",
44-
"getAllByRole",
45-
"queryByRole",
46-
"queryAllByRole",
47-
"findByRole",
48-
"findAllByRole",
49-
"findAllByDisplayValue",
50-
"getByTestId",
51-
"getAllByTestId",
52-
"queryByTestId",
53-
"queryAllByTestId",
54-
"findByTestId",
55-
"findAllByTestId",
56-
"screen",
5+
configureOnce,
6+
configure,
7+
within,
8+
getByLabelText,
9+
getAllByLabelText,
10+
queryByLabelText,
11+
queryAllByLabelText,
12+
findByLabelText,
13+
findAllByLabelText,
14+
getByPlaceholderText,
15+
getAllByPlaceholderText,
16+
queryByPlaceholderText,
17+
queryAllByPlaceholderText,
18+
findByPlaceholderText,
19+
findAllByPlaceholderText,
20+
getByText,
21+
getAllByText,
22+
queryByText,
23+
queryAllByText,
24+
findByText,
25+
findAllByText,
26+
getByAltText,
27+
getAllByAltText,
28+
queryByAltText,
29+
queryAllByAltText,
30+
findByAltText,
31+
findAllByAltText,
32+
getByTitle,
33+
getAllByTitle,
34+
queryByTitle,
35+
queryAllByTitle,
36+
findByTitle,
37+
findAllByTitle,
38+
getByDisplayValue,
39+
getAllByDisplayValue,
40+
queryByDisplayValue,
41+
queryAllByDisplayValue,
42+
findByDisplayValue,
43+
getByRole,
44+
getAllByRole,
45+
queryByRole,
46+
queryAllByRole,
47+
findByRole,
48+
findAllByRole,
49+
findAllByDisplayValue,
50+
getByTestId,
51+
getAllByTestId,
52+
queryByTestId,
53+
queryAllByTestId,
54+
findByTestId,
55+
findAllByTestId,
56+
screen,
5757
]
5858
`;

tests/unit/selectors.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ it("exports expected exports", () => {
2020
});
2121

2222
it("exports all dom-testing-library queries", () => {
23-
const {
24-
configureOnce,
25-
configure,
26-
within,
27-
screen,
28-
...justSelectors
29-
} = allExports;
23+
const { configureOnce, configure, within, screen, ...justSelectors } =
24+
allExports;
3025
expect(Object.keys(justSelectors).sort()).toEqual(
3126
Object.keys(queries).sort()
3227
);

0 commit comments

Comments
 (0)