Integration test: default announce list changed
This commit is contained in:
@@ -11,6 +11,7 @@ module.exports = {
|
||||
screenshotCreateOrCompare,
|
||||
compareDownloadFolder,
|
||||
compareFiles,
|
||||
compareTorrentFile,
|
||||
compareTorrentFiles,
|
||||
waitForLoad,
|
||||
wait,
|
||||
@@ -185,6 +186,13 @@ function compareTorrentFiles (t, pathActual, pathExpected) {
|
||||
t.deepEqual(fieldsActual, fieldsExpected, 'torrent contents: ' + pathActual)
|
||||
}
|
||||
|
||||
// Makes sure two torrents have the same infohash and flags
|
||||
function compareTorrentFile (t, pathActual, fieldsExpected) {
|
||||
const bufActual = fs.readFileSync(pathActual)
|
||||
const fieldsActual = extractImportantFields(parseTorrent(bufActual))
|
||||
t.deepEqual(fieldsActual, fieldsExpected, 'torrent contents: ' + pathActual)
|
||||
}
|
||||
|
||||
function extractImportantFields (parsedTorrent) {
|
||||
const { infoHash, name, announce, urlList, comment } = parsedTorrent
|
||||
const priv = parsedTorrent.private // private is a reserved word in JS
|
||||
|
||||
Reference in New Issue
Block a user