mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 04:57:04 +03:00
Add endpoints for rating endpoint (dislikes)
https://github.com/ajayyy/SponsorBlock/issues/1039
This commit is contained in:
24
test/test.ts
24
test/test.ts
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user