mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-23 16:08:25 +03:00
lint & fix tests
This commit is contained in:
@@ -326,7 +326,7 @@ describe('getSkipSegments', () => {
|
||||
else done();
|
||||
}
|
||||
})
|
||||
.catch(err => done("Couldn't call endpoint"));
|
||||
.catch(() => done("Couldn't call endpoint"));
|
||||
});
|
||||
|
||||
it('Should be able to get specific segments with repeating requiredSegment', (done: Done) => {
|
||||
@@ -341,6 +341,6 @@ describe('getSkipSegments', () => {
|
||||
else done();
|
||||
}
|
||||
})
|
||||
.catch(err => done("Couldn't call endpoint"));
|
||||
.catch(() => done("Couldn't call endpoint"));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -252,7 +252,7 @@ describe('getSegmentsByHash', () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => ("Couldn't call endpoint"));
|
||||
.catch(() => ("Couldn't call endpoint"));
|
||||
});
|
||||
|
||||
it('Should be able to get specific segments with requiredSegments', (done: Done) => {
|
||||
@@ -268,7 +268,7 @@ describe('getSegmentsByHash', () => {
|
||||
else done();
|
||||
}
|
||||
})
|
||||
.catch(err => done("Couldn't call endpoint"));
|
||||
.catch(() => done("Couldn't call endpoint"));
|
||||
});
|
||||
|
||||
it('Should be able to get specific segments with repeating requiredSegment', (done: Done) => {
|
||||
@@ -284,6 +284,6 @@ describe('getSegmentsByHash', () => {
|
||||
else done();
|
||||
}
|
||||
})
|
||||
.catch(err => done("Couldn't call endpoint"));
|
||||
.catch(() => done("Couldn't call endpoint"));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -165,7 +165,7 @@ describe('getUserInfo', () => {
|
||||
const data = await res.json();
|
||||
for (const value in data) {
|
||||
if (data[value] === null && value !== "lastSegmentID") {
|
||||
done(`returned null for ${value}`)
|
||||
done(`returned null for ${value}`);
|
||||
}
|
||||
}
|
||||
done(); // pass
|
||||
|
||||
@@ -46,6 +46,7 @@ async function getLastLogUserNameChange(userID: string) {
|
||||
}
|
||||
|
||||
function wellFormatUserName(userName: string) {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
return userName.replace(/[\u0000-\u001F\u007F-\u009F]/g, '');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user