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

Consider break in for-loop #46

Open
compulim opened this issue Oct 12, 2024 · 0 comments
Open

Consider break in for-loop #46

compulim opened this issue Oct 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@compulim
Copy link
Owner

Version

Latest development (@main)

Module resolution

Others or unrelated

Bundler

Others or unrelated

Environment

Others or unrelated

Test case

describe('when iterating', () => {
  let iterator: AsyncIterableIterator<number>;
  let values: number[];

  beforeEach(async () => {
    fn.mockImplementationOnce(() => [1, 2, 3].values());
    iterator = rpc.withOptions({ signal: abortController.signal })({ hello: 'World!' });

    values = [];

    for await (const value of iterator) {
      values.push(value);

      break;
    }
  });

  test('should throw on iterator?', () => {});
});

Coding sandbox URL

No response

Console errors

No response

Screenshots

No response

Additional context

What should happen when calling next() after break (which probably called return())?

@compulim compulim added the bug Something isn't working label Oct 12, 2024
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

1 participant