Skip to content

feat(time): support promise test completion - #1015

Open
cerredz wants to merge 1 commit into
cyclejs:masterfrom
cerredz:issuehunt-765-time-run-promise
Open

feat(time): support promise test completion#1015
cerredz wants to merge 1 commit into
cyclejs:masterfrom
cerredz:issuehunt-765-time-run-promise

Conversation

@cerredz

@cerredz cerredz commented May 16, 2026

Copy link
Copy Markdown

Summary

  • make mockTimeSource().run() return a Promise when called without a callback, while preserving the existing callback form
  • add overloads for xstream, RxJS, and most entrypoints so await Time.run() type-checks
  • document both callback and async/await usage for test frameworks such as AVA

Fixes #765

Verification

  • node_modules\.bin\tsc.cmd --module commonjs --outDir .\lib\cjs
  • node_modules\.bin\tsc.cmd --module es6 --outDir .\lib\es6
  • node_modules\.bin\tslint.cmd --project tsconfig.lint.json --config ..\tslint.json
  • node_modules\.bin\markdown-doctest.CMD (21 passed, 7 skipped)
  • node_modules\.bin\mocha.cmd test/time.ts --require ts-node/register --grep promise-style --exit (6 passing)
  • git diff --check

Note: the full node_modules\.bin\mocha.cmd test/**/*.ts --require ts-node/register --exit run reaches 118 passing tests including the new promise tests, then fails 12 existing unsubscribe timing assertions with the same [0, 1] vs [0] pattern across xstream/RxJS/most on this Windows + Node 22 environment. The focused promise tests pass independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support alternative testing frameworks such as Ava

1 participant