Skip to content

Commit

Permalink
test: fix test case error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 28, 2023
1 parent 59479cc commit 694673b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
],
"license": "MIT",
"jest": {
"extensionsToTreatAsEsm": [".ts"],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"testMatch": [
"<rootDir>/packages/**/src/**/__test__/*.{js,ts}"
],
Expand Down
4 changes: 2 additions & 2 deletions packages/html-to-markdown/src/__test__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import htmlToMarkdown from '..';
import htmlToMarkdown from '../index.js';

it('htmlToMarkdown test case basic-syntax', async () => {
expect(await htmlToMarkdown()).toEqual('');
Expand All @@ -21,7 +21,7 @@ it('htmlToMarkdown test case ignore', async () => {

it('htmlToMarkdown test list', async () => {
expect(await htmlToMarkdown({ html: `<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" checked="" disabled=""> <code>idoc.yml</code> 在根目录下添加</li> <li class="task-list-item"><input type="checkbox" checked="" disabled=""> <code>idoc.chapters.yml</code> 左侧栏文件导航</li> <li class="task-list-item"><input type="checkbox" checked="" disabled=""> <code>注释配置</code> 在 markdown 文档中添加的配置</li> </ul>` }))
.toEqual('* `idoc.yml` 在根目录下添加\n* `idoc.chapters.yml` 左侧栏文件导航\n* `注释配置` 在 markdown 文档中添加的配置\n');
.toEqual('* `idoc.yml` 在根目录下添加\n* `idoc.chapters.yml` 左侧栏文件导航\n* `注释配置` 在 markdown 文档中添加的配置\n');
});

const tableStr = `<table>
Expand Down

0 comments on commit 694673b

Please sign in to comment.