ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix tests
Chocobozzze2b2c4633983
diff --git a/.mocharc.cjs b/.mocharc.cjsindex 7844652481..a9ed4037c2 100644--- a/.mocharc.cjs+++ b/.mocharc.cjs@@ -2,7 +2,7 @@ process.env.TSX_TSCONFIG_PATH = './packages/tests/tsconfig.json'module.exports = {"node-option": [- "loader=tsx/esm",+ "import=tsx","no-warnings","conditions=peertube:tsx"],diff --git a/packages/tests/src/shared/webtorrent.ts b/packages/tests/src/shared/webtorrent.tsindex 1be54426a1..c226fd2437 100644--- a/packages/tests/src/shared/webtorrent.ts+++ b/packages/tests/src/shared/webtorrent.ts@@ -1,6 +1,5 @@import { expect } from 'chai'import { readFile } from 'fs/promises'-import parseTorrent from 'parse-torrent'import { basename, join } from 'path'import type { Instance, Torrent } from 'webtorrent'import { VideoFile } from '@peertube/peertube-models'@@ -26,7 +25,9 @@ export async function parseTorrentVideo (server: PeerTubeServer, file: VideoFileconst data = await readFile(torrentPath)- return parseTorrent(data)+ // FIXME: use classic import, on node 18.18 we have an error+ // "[ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../node_modules/parse-torrent/package.json"+ return require('parse-torrent')(data)}// ---------------------------------------------------------------------------