fast-check official documentation | fast-check

Illustration for Testing made easy

Testing made easy

Finding bugs has never been so easy! From classical edge cases to very complex combinations of inputs, fast-check is able to detect any class of bug.

Illustration for Test runner agnostic

Test runner agnostic

fast-check can be used within any test runner without any specific integration needed. It works well with Jest, Mocha, Vitest, and others.

Illustration for Next level testing

Next level testing

Let fuzzing and generative testing help you into uncovering the most challenging bugs: race conditions, prototype poisoning, zero-days…

test('validates substring presence in concatenated string', () => {
fc.assert(
fc.property(fc.string(), fc.string(), fc.string(), (a, b, c) => {
expect(isSubstring(`${a}${b}${c}`, b)).toBe(true);
})
);
});