feat: Add core trading modules for risk management, backtesting, and execution algorithms, alongside a new ML transparency widget and related frontend dependencies.
Some checks are pending
Documentation / build-docs (push) Waiting to run
Tests / test (macos-latest, 3.11) (push) Waiting to run
Tests / test (macos-latest, 3.12) (push) Waiting to run
Tests / test (macos-latest, 3.13) (push) Waiting to run
Tests / test (macos-latest, 3.14) (push) Waiting to run
Tests / test (ubuntu-latest, 3.11) (push) Waiting to run
Tests / test (ubuntu-latest, 3.12) (push) Waiting to run
Tests / test (ubuntu-latest, 3.13) (push) Waiting to run
Tests / test (ubuntu-latest, 3.14) (push) Waiting to run

This commit is contained in:
2025-12-31 21:25:06 -05:00
parent 099432bf3f
commit 7bd6be64a4
743 changed files with 8617 additions and 5042 deletions

View File

@@ -289,3 +289,37 @@ test('drained should handle undefined drain function', async function (t) {
t.pass('drained resolved successfully with undefined drain')
})
test('abort rejects all pending promises', async function (t) {
const queue = buildQueue(worker, 1)
const promises = []
let rejectedCount = 0
// Pause queue to prevent tasks from starting
queue.pause()
for (let i = 0; i < 10; i++) {
promises.push(queue.push(i))
}
queue.abort()
// All promises should be rejected
for (const promise of promises) {
try {
await promise
t.fail('promise should have been rejected')
} catch (err) {
t.equal(err.message, 'abort', 'error message is abort')
rejectedCount++
}
}
t.equal(rejectedCount, 10, 'all promises were rejected')
t.equal(queue.length(), 0, 'queue is empty')
async function worker (arg) {
await sleep(500)
return arg
}
})