Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Revert Jest Runners for linting and upgrade Jest to 23 🎉 #6412

Merged

Conversation

wldcordeiro
Copy link
Contributor

Summary of Changes

  • Revert usage of Jest runners for linting/prettier
  • Jest 23 upgrade!

@jasonLaster requested this as we were seeing some weirdness and large outputs.

@@ -515,7 +515,7 @@ We shallow render the component and simulate an UI interaction like `click`.

```js
it("should call handleClick function", () => {
const onClick = jest.genMockFunction();
const onClick = jest.fn();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genMockFunction was removed and was an undocumented API. Removing it from our examples and code.

jestjs/jest#6173

@@ -529,7 +529,7 @@ We shallow render the component to a JSON and save it to a fixture. Subsequent r

```js
it("should render a button", () => {
const onClick = jest.genMockFunction();
const onClick = jest.fn();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genMockFunction was removed and was an undocumented API. Removing it from our examples and code.

jestjs/jest#6173

| Type | Command |
| -------- | ------------------- |
| all | `yarn run lint` |
| css | `yarn run lint:css` |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We swapped back and forth on using - and : in the config so I just settled on :

@@ -15,7 +15,7 @@ function createMockDocument(clear) {
const doc = {
addLineClass: jest.fn(),
removeLineClass: jest.fn(),
markText: jest.genMockFunction().mockReturnValue({ clear }),
markText: jest.fn(() => ({ clear })),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genMockFunction was removed and was an undocumented API. Removing it from our examples and code.

jestjs/jest#6173

@@ -6,7 +6,7 @@ import React from "react";
import { shallow } from "enzyme";
import ResultList from "../ResultList";

const selectItem = jest.genMockFunction();
const selectItem = jest.fn();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genMockFunction was removed and was an undocumented API. Removing it from our examples and code.

jestjs/jest#6173

@@ -17,7 +17,7 @@ const mockFunctionText = "mock function text";

function generateDefaults(overrides) {
return {
selectLocation: jest.genMockFunction(),
selectLocation: jest.fn(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genMockFunction was removed and was an undocumented API. Removing it from our examples and code.

jestjs/jest#6173

@jasonLaster jasonLaster merged commit 7f6157a into firefox-devtools:master May 25, 2018
@wldcordeiro wldcordeiro deleted the rollback-jest-runners branch May 25, 2018 14:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants