Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Upgrade unmock and add unmock-jest-runner #36

Merged
merged 3 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated tests to use unmock-jest-runner
  • Loading branch information
carolstran committed Feb 13, 2020
commit 4293c309315316475e10ff7a577effa5d45d5d1f
12 changes: 6 additions & 6 deletions slack-typescript/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import axios from "axios";
import unmock,
{
Service,
transform,
runner
transform
} from "unmock";
import jestRunner from "unmock-jest-runner"

const { responseBody, withCodes, withoutCodes, mapDefaultTo } = transform;

Expand Down Expand Up @@ -39,7 +39,7 @@ const slackApi = {

jest.setTimeout(10000);

test("I can list some fake channels", runner(async () => {
test("I can list some fake channels", jestRunner(async () => {
slack.state(withCodes(200));
const data = await slackApi.channelsList();
// There are some channels indeed
Expand All @@ -50,7 +50,7 @@ test("I can list some fake channels", runner(async () => {
).toBeTruthy();
}));

test("I can force an error on all responses", runner(async () => {
test("I can force an error on all responses", jestRunner(async () => {
slack.state(
mapDefaultTo(200),
withCodes(200)
Expand All @@ -63,7 +63,7 @@ test("I can force an error on all responses", runner(async () => {
expect(typeof channelsInfo.error).toBe("string");
}));

test("I can set force a response for specific endpoints", runner(async () => {
test("I can set force a response for specific endpoints", jestRunner(async () => {
slack.state(
mapDefaultTo(200, "/channels.list"),
withCodes(200, "/channels.list"),
Expand All @@ -78,7 +78,7 @@ test("I can set force a response for specific endpoints", runner(async () => {
expect(channelsInfo.ok).toBeTruthy();
}));

test("I can also set a specific method", runner(async () => {
test("I can also set a specific method", jestRunner(async () => {
slack.state(
withoutCodes("default"),
responseBody({
Expand Down
Loading