Fix tests
This commit is contained in:
		
							parent
							
								
									0eff76f800
								
							
						
					
					
						commit
						e2b2c46339
					
				
					 2 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue