---
title: "toBeGreaterThan() | Grafana k6 documentation"
description: "Asserts that a numeric value is greater than another value"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# toBeGreaterThan()

The `toBeGreaterThan()` method asserts that a numeric value is greater than another value.

## Syntax

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
expect(actual).toBeGreaterThan(expected);
expect(actual).not.toBeGreaterThan(expected);
```

## Parameters

Expand table

| Parameter | Type   | Description                  |
|-----------|--------|------------------------------|
| expected  | number | The value to compare against |

## Returns

Expand table

| Type | Description     |
|------|-----------------|
| void | No return value |

## Description

The `toBeGreaterThan()` method performs a numeric comparison using the `>` operator. Both values must be numbers, or the assertion will fail.

## Usage

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { expect } from 'https://jslib.k6.io/k6-testing/0.6.1/index.js';

export default function () {
  expect(5).toBeGreaterThan(3);
  expect(10.5).toBeGreaterThan(10);
  expect(-1).toBeGreaterThan(-5);
  expect(0).toBeGreaterThan(-1);
}
```
