mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-23 01:06:46 -06:00
Fix tests
This commit is contained in:
parent
0eff76f800
commit
e2b2c46339
@ -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"
|
||||
],
|
||||
|
@ -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: 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)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user