---
description: Discards fuzz inputs if the next call reverts
---

## `assumeNoRevert`

### Signature

```solidity
function assumeNoRevert() external;
```

### Description

The fuzzer will discard the current fuzz inputs and start a new fuzz run if the **next call** reverts.

This is useful when testing functions that have input validation, allowing the fuzzer to automatically find valid inputs.

### Examples

:::code-group

```solidity [test/AssumeNoRevert.t.sol]
function testDoSomething(uint256 amount) public {
    vm.assumeNoRevert();
    target.doSomething(amount);
    // Passes if valid inputs are found
}
```

```solidity [src/Target.sol]
function doSomething(uint256 amount) public {
    require(amount > 100 ether && amount < 1_000 ether);
    // ... logic
}
```

:::

### Gotchas

:::warning
The test may fail if you hit the max number of rejects (i.e., too many fuzz inputs cause reverts).

Configure the rejection threshold with [`fuzz.max_test_rejects`](/config/reference/testing#max_test_rejects) in `foundry.toml`.
:::

### Related Cheatcodes

- [`assume`](/reference/cheatcodes/assume) - Discard fuzz inputs based on a boolean condition
