close
logo
Rstest
Guide
Config
API
English
简体中文
Guide
Config
API
English
简体中文
logo
Rstest
Overview

Test API

Expect
Test
Describe
Hooks

Rstest Utility

Mock modules
Mock functions
MockInstance
Fake timers
Utilities
📝 Edit this page on GitHub
Previous PageHooks
Next PageMock modules

#Rstest utility

Rstest provides utility functions to help you out through its rstest helper.

You can import it from @rstest/core directly, and you can also use its alias rs.

import { rstest } from '@rstest/core';

const fn = rstest.fn();
fn.mockResolvedValue('foo');
import { rs } from '@rstest/core';

const fn = rs.fn();
fn.mockResolvedValue('foo');

Or, you can access it globally like jest (when globals configuration is enabled).