Skip to content

Commit

Permalink
test: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Mar 27, 2024
1 parent e0d6764 commit 994414e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/loaders/markdown/transformer/fixtures/embed/embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,29 @@ type:null
:::success
这是一条成功信息
:::

### CodeGroup

:::code-group

```bash [npm]
npm install -D dumi
```

```bash [yarn]
yarn add -D dumi
```

```bash [pnpm]
pnpm add -D dumi
```

```ts [.dumirc.ts]
import { defineConfig } from 'dumi';

export default defineConfig({
// ...
});
```

:::
2 changes: 1 addition & 1 deletion src/loaders/markdown/transformer/fixtures/embed/expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IMdTransformerResult } from '../..';

export default (ret: IMdTransformerResult) => {
expect(ret.content).toEqual(
'<><div className="markdown"><h3 id="this-is-indexmd"><a aria-hidden="true" tabIndex="-1" href="#this-is-indexmd"><span className="icon icon-link" /></a>{"This is index.md"}</h3><h3 id="this-is-embedmd"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[0].value}</p><p>{$$contentTexts[1].value}</p><p>{$$contentTexts[2].value}</p></div><Container type="success"><p>{$$contentTexts[3].value}</p></Container><div className="markdown"><h3 id="this-is-embedmd-1"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-1"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><h3 id="this-is-embedmd-2"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-2"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[4].value}</p><h3 id="this-is-embedmd-3"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-3"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[5].value}</p><p>{$$contentTexts[6].value}</p><p>{$$contentTexts[7].value}</p></div><Container type="success"><p>{$$contentTexts[8].value}</p></Container><div className="markdown"><h3 id="this-is-embedmd-4"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-4"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[9].value}</p><p>{$$contentTexts[10].value}</p><p>{$$contentTexts[11].value}</p></div><Container type="success"><p>{$$contentTexts[12].value}</p></Container></>',
'<><div className="markdown"><h3 id="this-is-indexmd"><a aria-hidden="true" tabIndex="-1" href="#this-is-indexmd"><span className="icon icon-link" /></a>{"This is index.md"}</h3><h3 id="this-is-embedmd"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[0].value}</p><p>{$$contentTexts[1].value}</p><p>{$$contentTexts[2].value}</p></div><Container type="success"><p>{$$contentTexts[3].value}</p></Container><div className="markdown"><h3 id="codegroup"><a aria-hidden="true" tabIndex="-1" href="#codegroup"><span className="icon icon-link" /></a>{"CodeGroup"}</h3></div><CodeGroup><SourceCode title="npm" lang="bash">{$$contentTexts[4].value}</SourceCode><SourceCode title="yarn" lang="bash">{$$contentTexts[5].value}</SourceCode><SourceCode title="pnpm" lang="bash">{$$contentTexts[6].value}</SourceCode><SourceCode title=".dumirc.ts" lang="ts">{$$contentTexts[7].value}</SourceCode></CodeGroup><div className="markdown"><h3 id="this-is-embedmd-1"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-1"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><h3 id="this-is-embedmd-2"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-2"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[8].value}</p><h3 id="this-is-embedmd-3"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-3"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[9].value}</p><p>{$$contentTexts[10].value}</p><p>{$$contentTexts[11].value}</p></div><Container type="success"><p>{$$contentTexts[12].value}</p></Container><div className="markdown"><h3 id="codegroup-1"><a aria-hidden="true" tabIndex="-1" href="#codegroup-1"><span className="icon icon-link" /></a>{"CodeGroup"}</h3></div><CodeGroup><SourceCode title="npm" lang="bash">{$$contentTexts[13].value}</SourceCode><SourceCode title="yarn" lang="bash">{$$contentTexts[14].value}</SourceCode><SourceCode title="pnpm" lang="bash">{$$contentTexts[15].value}</SourceCode><SourceCode title=".dumirc.ts" lang="ts">{$$contentTexts[16].value}</SourceCode></CodeGroup><div className="markdown"><h3 id="this-is-embedmd-4"><a aria-hidden="true" tabIndex="-1" href="#this-is-embedmd-4"><span className="icon icon-link" /></a>{"This is embed.md"}</h3><p>{$$contentTexts[17].value}</p><p>{$$contentTexts[18].value}</p><p>{$$contentTexts[19].value}</p></div><Container type="success"><p>{$$contentTexts[20].value}</p></Container><div className="markdown"><h3 id="codegroup-2"><a aria-hidden="true" tabIndex="-1" href="#codegroup-2"><span className="icon icon-link" /></a>{"CodeGroup"}</h3></div><CodeGroup><SourceCode title="npm" lang="bash">{$$contentTexts[21].value}</SourceCode><SourceCode title="yarn" lang="bash">{$$contentTexts[22].value}</SourceCode><SourceCode title="pnpm" lang="bash">{$$contentTexts[23].value}</SourceCode><SourceCode title=".dumirc.ts" lang="ts">{$$contentTexts[24].value}</SourceCode></CodeGroup></>',
);

expect(ret.meta.texts?.[2].value).toEqual('type:null');
Expand Down

0 comments on commit 994414e

Please sign in to comment.