Add endpoints for rating endpoint (dislikes)

https://github.com/ajayyy/SponsorBlock/issues/1039
This commit is contained in:
Ajay Ramachandran
2021-11-14 23:09:12 -05:00
parent 7590047c6d
commit bc6db0d109
17 changed files with 415 additions and 14 deletions

View File

@@ -32,19 +32,21 @@ async function init() {
// Instantiate a Mocha instance.
const mocha = new Mocha();
const testDir = "./test/cases";
const testDirs = ["./test/cases", "./test/cases/ratings"];
// Add each .ts file to the mocha instance
fs.readdirSync(testDir)
.filter((file) =>
// Only keep the .ts files
file.substr(-3) === ".ts"
)
.forEach(function(file) {
mocha.addFile(
path.join(testDir, file)
);
});
testDirs.forEach(testDir => {
fs.readdirSync(testDir)
.filter((file) =>
// Only keep the .ts files
file.substr(-3) === ".ts"
)
.forEach(function(file) {
mocha.addFile(
path.join(testDir, file)
);
});
});
const mockServer = createMockServer(() => {
Logger.info("Started mock HTTP Server");