-
Notifications
You must be signed in to change notification settings - Fork 108
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
is it still useful? #93
Comments
Duh, your resolved and rejected functions return custom values, instead of the values passed in by the test. This one works as expected: const adapter = {
deferred: () => {
let resolve;
let reject;
const promise = new Promise((res, rej) => { resolve = res; reject = rej; });
return {
promise,
reject,
resolve,
};
},
rejected: (reason) => Promise.reject(reason),
resolved: (value) => Promise.resolve(value),
}; |
const Pinky = Promise
module.exports = {
resolved: function(value) {
return Pinky.resolve(value)
},
rejected: function(reason) {
return Pinky.resolve(reason)
},
deferred: function() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let res; let rej
const prom = new Pinky((resolve, reject) => {
res = resolve; rej = reject
})
return {
promise: prom,
resolve: res,
reject: rej,
}
},
} OK, even though I have changed my code as you mentioned, I still got many errors. |
node 14.16.0 passed all the tests.
|
% node --version
v20.3.0
same 2.3.3 failures |
It seems that the test suite fails since node 15 because of the unhandledrejection changes.
// adapter.js
module.exports = {
deferred() {
let resolve, reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return {
promise,
resolve,
reject,
};
},
};
require('process').on('unhandledRejection', (err) => { console.debug('unhandledRejection', err) }); 872 passing (13s) |
Even
node.js
's built-inPromise
can't pass these test cases.many many errors I got....
The text was updated successfully, but these errors were encountered: