Add tests for non-registered symbols in Weak{Map,Set,Ref} and FinalizationRegistry#1445
Conversation
queengooborg
left a comment
There was a problem hiding this comment.
Hey @lionel-rowe, thanks for doing this!
The changes make sense to me, but let's add the testOk helper in a separate PR and perform a complete migration, both to ensure that we've fully switched to it and to keep the diff clean! (Note: In the new helper function, we'll need to add a .catch() to promises as well.)
I also just noticed that your commits are unverified! It looks like the commits are signed, but could not be verified as GitHub does not have your public key. We require commits to be signed and verified -- would you mind configuring your signing key accordingly?
This reverts commit a8cb6e6.
Sure, makes sense — reverted for now. Re
Fixed that too 👍 |
Actually, no, the second argument handles if the promise was rejected, not if it failed due to an error. So, we want something like this: |
At risk of derailing this PR, I don't think that's true. In the context of a promise, throwing and synchronously calling the // in all of the below cases, console warns with `!`
// value of `results` is `{ status: 'fulfilled', value: undefined }` * 4
const results = await Promise.allSettled([
new Promise(() => { throw '!' }).then(console.log, console.warn),
new Promise((_, rej) => rej('!')).then(console.log, console.warn),
new Promise(() => { throw '!' }).then(console.log).catch(console.warn),
new Promise((_, rej) => rej('!')).then(console.log).catch(console.warn),
]) |
queengooborg
left a comment
There was a problem hiding this comment.
In regards to the changes performed in this PR, thank you very much for writing these tests, this is looking good to me! Welcome to the collector project!
I've added atestOkharness as similartry { testLogic(); return true } catch(e) { return { result: false, message: e.message } }logic seems to be repeated a lot, but I've only used it for the newly added tests for now.