Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Feb 23, 2024
1 parent 0eff76f commit e2b2c46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down
5 changes: 3 additions & 2 deletions packages/tests/src/shared/webtorrent.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -26,7 +25,9 @@ export async function parseTorrentVideo (server: PeerTubeServer, file: VideoFile

const 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)
}

// ---------------------------------------------------------------------------
Expand Down

0 comments on commit e2b2c46

Please sign in to comment.