mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Fix any type
This commit is contained in:
parent
6fcfeb2889
commit
feba2af9ed
1 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@ import {getHash} from '../../src/utils/getHash';
|
|||
import {db} from '../../src/databases/databases';
|
||||
import {LockCategory} from '../../src/types/segments.model';
|
||||
|
||||
const deepEquals = (a,b) => {
|
||||
const deepEquals = (a: string[],b: string[]) => {
|
||||
a.forEach((e) => { if (!b.includes(e)) return false; });
|
||||
return true;
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ describe('lockCategoriesRecords', () => {
|
|||
.then(async res => {
|
||||
if (res.status === 200) {
|
||||
const data = await res.json();
|
||||
if (deepEquals(data, expected)) {
|
||||
if (deepEquals(data.submitted, expected.submitted)) {
|
||||
done();
|
||||
} else {
|
||||
done("Incorrect response: expected " + JSON.stringify(expected) + " got " + JSON.stringify(data));
|
||||
|
@ -158,7 +158,7 @@ describe('lockCategoriesRecords', () => {
|
|||
.then(async res => {
|
||||
if (res.status === 200) {
|
||||
const data = await res.json();
|
||||
if (deepEquals(data, expected)) {
|
||||
if (deepEquals(data.submitted, expected.submitted)) {
|
||||
done();
|
||||
} else {
|
||||
done("Incorrect response: expected " + JSON.stringify(expected) + " got " + JSON.stringify(data));
|
||||
|
@ -670,7 +670,7 @@ describe('lockCategoriesRecords', () => {
|
|||
.then(async res => {
|
||||
if (res.status === 200) {
|
||||
const data = await res.json();
|
||||
if (deepEquals(data, expected)) {
|
||||
if (deepEquals(data.categories, expected.categories)) {
|
||||
done();
|
||||
} else {
|
||||
done("Incorrect response: expected " + JSON.stringify(expected) + " got " + JSON.stringify(data));
|
||||
|
|
Loading…
Reference in a new issue