-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4c7467
commit e7f885f
Showing
7 changed files
with
37 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ export function Log() { | |
if (logs.length === 0) { | ||
return { | ||
content: "", | ||
score: <></>, | ||
score: null, | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
import { it } from "vitest" | ||
import { exportLib } from "../src/db" | ||
import { checkDatabases, databases } from "src/db" | ||
import { getLibWords, getLibs } from "src/query" | ||
import { beforeAll, expect, it } from "vitest" | ||
|
||
it.skip("db", async () => { | ||
const r = { | ||
status: "selected", | ||
selected: [{ id: 76, name: "2012雅思词汇加强版" }], | ||
type: "base", | ||
options: { | ||
target: ["word", "translation", "list"], | ||
previewTarget: "word", | ||
exculedMemorized: false, | ||
folderName: "", | ||
override: true, | ||
}, | ||
} | ||
await exportLib(r.status, r.selected, r.type, r.options, (info: string) => { | ||
console.log(info) | ||
return false | ||
}) | ||
beforeAll(() => { | ||
checkDatabases() | ||
}) | ||
|
||
it("test", () => { | ||
const date = new Date() | ||
console.log(new Date(date.getTime() - date.getTimezoneOffset() * 60 * 1000)) | ||
it("db status", async () => { | ||
expect(databases.ecdict?.status).toBe(true) | ||
expect(databases.maimemo_base?.status).toBe(true) | ||
expect(databases.maimemo_cloud?.status).toBe(true) | ||
}) | ||
|
||
it("get libs", () => { | ||
expect(getLibs("base").length).toBeGreaterThan(0) | ||
expect(getLibs("cloud").length).toBeGreaterThan(0) | ||
}) | ||
|
||
it("get lib words", () => { | ||
const words = getLibWords({ id: 13110210, type: "base", exculedMemorized: false }) | ||
expect(words.length).toBeGreaterThan(0) | ||
expect(getLibWords({ id: 13110210, type: "base", exculedMemorized: true }).length).toBeLessThan(words.length) | ||
expect(getLibWords({ id: 458595, type: "cloud", exculedMemorized: false }).length).toBeGreaterThan(0) | ||
}) |