Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Module '"reassure"' has no exported member 'measureRenders' #447

Closed
sbalay opened this issue Jan 28, 2024 · 4 comments
Closed

[BUG] Module '"reassure"' has no exported member 'measureRenders' #447

sbalay opened this issue Jan 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@sbalay
Copy link

sbalay commented Jan 28, 2024

Describe the bug
Following the README instructions I wrote my test case:

import { measureRenders } from 'reassure';
import { screen, fireEvent } from '@testing-library/react-native';
import { ComponentUnderTest } from './ComponentUnderTest';

test('Test with scenario', async () => {
  const scenario = async () => {
    fireEvent.press(screen.getByText('Go'));
    await screen.findByText('Done');
  };

  await measureRenders(<ComponentUnderTest />, { scenario });
});

However, as my test file is written in typescript, I got the following error on vscode: Module '"reassure"' has no exported member 'measureRenders'.ts(2305)

It might be that I made a mistake following the instructions, or either the typescript types of the library are wrong or the README is outdated?

To Reproduce
Create a stub component in a file called ComponentUnderTest and then create a perf-test for it using typescript

import { measureRenders } from 'reassure';
import { screen, fireEvent } from '@testing-library/react-native';
import { ComponentUnderTest } from './ComponentUnderTest';

test('Test with scenario', async () => {
  const scenario = async () => {
    fireEvent.press(screen.getByText('Go'));
    await screen.findByText('Done');
  };

  await measureRenders(<ComponentUnderTest />, { scenario });
});

See that there's a typescript error reported in vscode

Expected behavior
It works

Screenshots
I don't think a screenshot would help here

Additional context
Using v0.10.2

@sbalay sbalay added the bug Something isn't working label Jan 28, 2024
@sbalay
Copy link
Author

sbalay commented Jan 28, 2024

Just saw that there was a recent rename introduced in #433

I guess those changes have not been released yet?

Closing, feel free to reopen if needed

@sbalay sbalay closed this as completed Jan 28, 2024
@mdjastrzebski
Copy link
Member

You are right, measureRenders is v1.0.0 name for measurePerformance. There is 1.0.0-beta, but not stable yet

@gutenye
Copy link

gutenye commented Feb 19, 2024

Had to go here to understand it. Maybe revert the doc changes before the new version is published?

@mdjastrzebski
Copy link
Member

Published docs fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants