Skip to content

Instantly share code, notes, and snippets.

@RA80533
Last active November 9, 2020 14:35
Show Gist options
  • Save RA80533/9158090b200d198691510f768984c98f to your computer and use it in GitHub Desktop.
Save RA80533/9158090b200d198691510f768984c98f to your computer and use it in GitHub Desktop.
/// <reference path="jest-chain" />
/// <reference path="jest-extended" />
import { main } from "./index";
describe(`${main.name}()`, () => {
const value = 1337 as const;
it(`resolves to ${value} (1)`, async () => {
await expect(main())
.toResolve().then((result) => {
expect(result)
.not.toBeUndefined()
.toBeDefined()
.toBeNumber()
.toBePositive()
.toBe(value);
});
});
it(`resolves to ${value} (2)`, async () => {
await expect(main())
.resolves.not.toBeUndefined()
.resolves.toBeDefined()
.resolves.toBeNumber()
.resolves.toBePositive()
.resolves.toBe(value);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment