Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Dec 1, 2023
1 parent 7a6d9c9 commit 0d8a150
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion page/SinglePage_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Deno.test({
assertEquals(re2.currentIndex, 19);
assertEquals(re2.gid, 2028320);
assertEquals(re2.name, "18.jpg");
assertEquals(re2.is_original, false);
assertEquals(re2.is_original, true);
assertEquals(re2.origin_xres, 4893);
assertEquals(re2.origin_yres, 3446);
console.log(np.nl, re.nl, re2.nl);
Expand Down
22 changes: 16 additions & 6 deletions utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,21 @@ Deno.test("calFileMd5_test", async () => {
});

Deno.test("asyncEvery_test", async () => {
const e = [new Promise<number>((res) => setTimeout(() => res(100), 100))];
// @ts-ignore: FUCKED UP
const list = [];
// @ts-ignore: FUCKED UP
function timeout(fun, time) {
list.push(setTimeout(fun, time));
}
const e = [new Promise<number>((res) => timeout(() => res(100), 100))];
const e2 = [
new Promise<number>((res) => setTimeout(() => res(100), 100)),
new Promise<number>((res) => setTimeout(() => res(200), 100)),
new Promise<number>((res) => timeout(() => res(100), 100)),
new Promise<number>((res) => timeout(() => res(200), 100)),
];
const e3 = [
new Promise<number>((res) => setTimeout(() => res(100), 100)),
new Promise<number>((res) => setTimeout(() => res(200), 100)),
new Promise<number>((res) => setTimeout(() => res(150), 100)),
new Promise<number>((res) => timeout(() => res(100), 100)),
new Promise<number>((res) => timeout(() => res(200), 100)),
new Promise<number>((res) => timeout(() => res(150), 100)),
];
const t = { test: 2 };
assertEquals(
Expand All @@ -137,6 +143,10 @@ Deno.test("asyncEvery_test", async () => {
}, t),
false,
);
// @ts-ignore: FUCKED UP
for (const i of list) {
clearTimeout(i);
}
});

Deno.test("map_test", () => {
Expand Down

0 comments on commit 0d8a150

Please sign in to comment.