-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
使用 jest 测试框架替换 mocha,并增加测试覆盖率的统计、推送到 coveralls
- Loading branch information
Showing
9 changed files
with
21 additions
and
19 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"mocha": true, | ||
"jest": true, | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
|
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,2 +1,3 @@ | ||
node_modules/ | ||
coverage/ | ||
|
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,12 +1,11 @@ | ||
import assert from "assert" | ||
import { | ||
escapeHtml, | ||
} from "../src/utils.js" | ||
|
||
describe("Utils Test", () => { | ||
it("escape html unsafe chars", () => { | ||
test("escape html unsafe chars", () => { | ||
let str = "<>&\"'"; | ||
assert.strictEqual(escapeHtml(str), "<>&"'"); | ||
expect(escapeHtml(str)).toBe("<>&"'"); | ||
}); | ||
}); | ||
|
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,9 +1,8 @@ | ||
import assert from "assert" | ||
import parser from "../src/index.js" | ||
|
||
describe("BMYBBS Content Parser Test", () => { | ||
it("Null content should return empty <article />", async () => { | ||
assert.strictEqual(await parser(null), "<article></article>"); | ||
test("Null content should return empty <article />", async () => { | ||
expect(await parser(null)).toBe("<article></article>"); | ||
}); | ||
}); | ||
|