Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Dec 11, 2023
1 parent 5f8ae6f commit a2053ad
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions server/routes/api/torrents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,31 @@ describe('POST /api/torrents/add-urls', () => {
});
});

describe('POST /api/torrents/delete', () => {
const torrentDeleted = watchTorrentList('remove');
it('Deletes added torrents', (done) => {
request
.post('/api/torrents/delete')
.send({hashes: torrentHashes, deleteData: true})

Check failure on line 207 in server/routes/api/torrents.test.ts

View workflow job for this annotation

GitHub Actions / check (20, check-types)

Cannot find name 'torrentHashes'. Did you mean 'torrentHash'?
.set('Cookie', [authToken])
.set('Accept', 'application/json')
.expect(200)
.expect('Content-Type', /json/)
.end((err, _res) => {
if (err) done(err);

Promise.race([torrentDeleted, new Promise((r) => setTimeout(r, 1000 * 15))])
.then(async () => {
// Wait a while
await new Promise((r) => setTimeout(r, 1000 * 3));
})
.then(() => {
done();
});
});
});
});

describe('POST /api/torrents/add-files', () => {
const addTorrentByFileOptions: AddTorrentByFileOptions = {
files: torrentFiles,
Expand Down

0 comments on commit a2053ad

Please sign in to comment.