close
  • English
  • Rstest utility

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

    You can import rs from @rstest/core directly.

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

    The longer rstest helper remains available as an alias.

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

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