supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
962 stars 128 forks source link

fix: abort signal test #495

Closed mmkal closed 4 weeks ago

mmkal commented 7 months ago

What kind of change does this PR introduce?

Fix a jest snapshot for the abort signal test

What is the current behavior?

The error message on my machine doesn't quite match what's in the snapshot. This might be because of a different node version (I'm on v20.8.0), so I updated the assertion to a regex that matches either one.

What is the new behavior?

An asymmetric matcher for the error message. Seems like the important thing for the test to do is make sure an AbortError error is thrown, but not really important the exact message since it's coming from the runtime.

Additional context

The error message I get on node v20.8.0 is "AbortError: This operation was aborted". The old snapshot was for "AbortError: The user aborted a request.".

soedirgo commented 4 weeks ago

Seems to have been fixed since, but thanks for the PR!