TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
TechVibe

7 Oct, 21:57

Open in Telegram Share Report

Tests passed locally, failed in CI

Today, two tests passed locally but failed in CI with this error

TypeError: object.stream is not a function The issue was that my machine was running Node 24, while CI was using Node 22.

The tests were running in jsdom, which provides its own Blob implementation. The mock used:
new Response(new Blob(['x']))
Node 24 accepted it, but Node 22 tried to call .stream() on the jsdom Blob, which doesn’t implement it.
The fix was to use new Response('x') It tests the same behavior without depending on the Blob implementation.

I’m also adding an .nvmrc file and an engines field to package.json so the expected Node version is clear. I’ll also start testing locally with the same Node version used in CI.

@devwitheyob
#CI #tips

143 0 0 3 4
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot