Skip to content

Commit

Permalink
rename export examples for clarity and conciseness
Browse files Browse the repository at this point in the history
  • Loading branch information
mercedesb committed Jul 12, 2020
1 parent ef0648e commit 95e19d2
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import example from "../defaultExportFunctionExample";
import example from "../defaultFunction";

const mockExpected = "mock value";
jest.mock("../defaultExportFunctionExample", () => jest.fn(() => mockExpected));
jest.mock("../defaultFunction", () => jest.fn(() => mockExpected));

it("returns the expected value", () => {
const actual = example();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as exampleModule from "../defaultExportStructuredExample";
import * as exampleModule from "../defaultFunctionReturnObject";

const mockExpected = "mock value";
jest.spyOn(exampleModule, "default").mockImplementation(() => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import example from "../defaultExportObjectExample";
import example from "../defaultObject";

const mockExpected = "mock value";
jest.spyOn(example, "getValue").mockImplementation(jest.fn(() => mockExpected));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { example } from "../namedExportObjectExample";
import { example } from "../namedFunction";

const mockExpected = "mock value";
jest.mock("../namedExportObjectExample", () => ({
jest.mock("../namedFunction", () => ({
example: jest.fn(() => mockExpected),
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as exampleModule from "../namedExportStructuredExample";
import * as exampleModule from "../namedFunctionReturnObject";

const mockExpected = "mock value";
jest.spyOn(exampleModule, "example").mockImplementation(() => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { example } from "../namedExportObjectExample";
import { example } from "../namedObject";

const mockExpected = "mock value";
jest.spyOn(example, "getValue").mockImplementation(jest.fn(() => mockExpected));
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
function example() {
export default function () {
return {
getValue: () => "real value",
};
}

export default example;
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 95e19d2

Please sign in to comment.