// Try running this with and without the following require: require('./jest-guard') test("I want this to fail, because I've forgotten to expect() anything", () => {}); test("I want this to fail because I haven't returned the expectation of a promise, and the assertion false", () => { expect(Promise.resolve(true)).resolves.toBe(false); }); // Don't have a solution for these yet :-( test("I want this to fail because I haven't returned the expectation of a promise even though the assertion passes", () => { expect(Promise.resolve(true)).resolves.toBe(true); }); function neverResolveOrReject() { return new Promise((resolve, reject) => {}); } test("I want this to fail because the promise never resolves or rejects - but it passes!!!", () => { expect(neverResolveOrReject()).resolves.toBe("something"); });