Skip to content

Commit

Permalink
Upgrade jest related libraries (hello-pangea#26)
Browse files Browse the repository at this point in the history
* Bump jest from 25.5.4 to 26.6.3

Bumps [jest](https://github.com/facebook/jest) from 25.5.4 to 26.6.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](jestjs/jest@v25.5.4...v26.6.3)

Signed-off-by: dependabot[bot] <[email protected]>

* deps: upgrade jest related libs

* fix: All tests were failing when passing hasAssertions directly to beforeEach

* fix: eslint issues

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Santerre <[email protected]>
  • Loading branch information
dependabot[bot] and 100terres authored Dec 30, 2020
1 parent 2005762 commit 0932017
Show file tree
Hide file tree
Showing 9 changed files with 635 additions and 713 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@typescript-eslint/parser": "^4.10.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.3.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.1.0",
"babel-plugin-dev-expression": "^0.2.2",
"babel-plugin-emotion": "^10.0.33",
Expand All @@ -122,18 +122,19 @@
"eslint-plugin-es5": "^1.5.0",
"eslint-plugin-flowtype": "^4.7.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^3.0.0",
"flow-bin": "0.110.1",
"fs-extra": "^9.0.0",
"globby": "^11.0.0",
"jest": "^25.3.0",
"jest": "^26.6.3",
"jest-axe": "^4.1.0",
"jest-junit": "^10.0.0",
"jest-watch-typeahead": "^0.5.0",
"jest-junit": "^12.0.0",
"jest-watch-typeahead": "^0.6.1",
"jsdom": "^16.4.0",
"lighthouse": "^7.0.0",
"markdown-it": "^12.0.4",
"prettier": "^2.0.4",
Expand Down
4 changes: 3 additions & 1 deletion test/test-setup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// @flow

// ensuring that each test has at least one assertion
beforeEach(expect.hasAssertions);
beforeEach(() => {
expect.hasAssertions();
});

if (typeof document !== 'undefined') {
// Simply importing this package will throw an error if document is not defined
Expand Down
1 change: 1 addition & 0 deletions test/unit/docs/content.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ it('should end all nested docs with a link back to the documentation root', asyn
const endsWithBacklink: boolean = contents.trim().endsWith(backLink);

if (!endsWithBacklink) {
// eslint-disable-next-line jest/no-conditional-expect
expect(`
File: "${file}"
Did not end with back link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ it('should not block any clicks after a timeout', () => {
const drag: SnapDragActions = preDrag.snapLift();
act(() => drag.drop({ shouldBlockNextClick: true }));

jest.runTimersToTime(1);
jest.advanceTimersByTime(1);

// fire click
const first: MouseEvent = createEvent.click(handle);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/integration/util/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const touch: Control = {
},
lift: () => {
act(() => {
jest.runTimersToTime(timeForLongPress);
jest.advanceTimersByTime(timeForLongPress);
});
},
move: (handle: HTMLElement) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ import {
const combineStart: Position = add(startOfInHome3, inHome3Threshold);
const combineEnd: Position = subtract(endOfInHome3, inHome3Threshold);

it('should move onto a target once it hits (1/5) of the targets size ', () => {
it('should move onto a target once it hits (1/5) of the targets size', () => {
const offset: Position = getOffsetForEndEdge({
endEdgeOn: combineStart,
dragging: preset.inHome2.page.borderBox,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/state/get-lift-effect/get-lift-effect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

const preset = getPreset();

it('should mark everything after the critical ', () => {
it('should mark everything after the critical', () => {
const { impact, afterCritical } = getLiftEffect({
draggable: preset.inHome2,
home: preset.home,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ cases.forEach((current: Case) => {
it('should announce with the default message if no responder is provided', () => {
// This test is not relevant for onDragEnd as it must always be provided
if (current.responder === 'onDragEnd') {
// eslint-disable-next-line jest/no-conditional-expect
expect(true).toBe(true);
return;
}
Expand Down
Loading

0 comments on commit 0932017

Please sign in to comment.