-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Describe the bug
// 1. create promise
let resolve, reject;
const promise = new Promise((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
}) as any;
// add any attributes to promise
promise.a = 1;
promise.resolve = resolve;
promise.reject = reject;
// 2. use promise callback
promise.finally(() => {
console.log('---');
});
// TypeError: Cannot create property 'type' on string 'manual-reject'
expect(promise).rejects.toBe('manual-reject');
// reject promise
reject('manual-reject');Reproduction
System Info
System:
OS: Windows 10 10.0.22000
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 1.49 GB / 15.93 GB
Binaries:
Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0)
Internet Explorer: 11.0.22000.120
npmPackages:
@vitejs/plugin-react: ^4.0.0 => 4.0.0
@vitejs/plugin-vue: ^4.0.0 => 4.0.0
@vitest/coverage-c8: ^0.29.2 => 0.29.2
vite: ^4.2.0 => 4.2.0
vitest: ^0.30.1 => 0.30.1Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
