mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
test(plugin-md-power): add python-repl unit test
This commit is contained in:
parent
1f89d7f515
commit
1dcd46c9c0
@ -17,6 +17,14 @@ exports[`langReplPlugin > should work with custom options 1`] = `
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl editable title="title"><pre><code class="language-rust"><div class="language-rust"><pre><code>const a = 1
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl title="python playground"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl editable title="python playground"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl title="title"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl editable title="title"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl>"
|
||||
`;
|
||||
|
||||
@ -31,6 +39,9 @@ exports[`langReplPlugin > should work with custom options 2`] = `
|
||||
},
|
||||
"rust": {
|
||||
"language": "rust"
|
||||
},
|
||||
"python": {
|
||||
"language": "python"
|
||||
}
|
||||
},
|
||||
"theme": {
|
||||
@ -61,6 +72,14 @@ exports[`langReplPlugin > should work with custom theme 1`] = `
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl editable title="title"><pre><code class="language-rust"><div class="language-rust"><pre><code>const a = 1
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl title="python playground"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl editable title="python playground"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl title="title"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl><CodeRepl editable title="title"><pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
</CodeRepl>"
|
||||
`;
|
||||
|
||||
@ -75,6 +94,9 @@ exports[`langReplPlugin > should work with custom theme 2`] = `
|
||||
},
|
||||
"rust": {
|
||||
"language": "rust"
|
||||
},
|
||||
"python": {
|
||||
"language": "python"
|
||||
}
|
||||
}
|
||||
}"
|
||||
@ -113,6 +135,22 @@ exports[`langReplPlugin > should work with default options 1`] = `
|
||||
<pre><code class="language-rust"><div class="language-rust"><pre><code>const a = 1
|
||||
</code></pre></div></code></pre>
|
||||
<p>:::</p>
|
||||
<p>::: python-repl</p>
|
||||
<pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
<p>:::</p>
|
||||
<p>::: python-repl editable</p>
|
||||
<pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
<p>:::</p>
|
||||
<p>::: python-repl title="title"</p>
|
||||
<pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
<p>:::</p>
|
||||
<p>::: python-repl editable title="title"</p>
|
||||
<pre><code class="language-python"><div class="language-python"><pre><code>hello_world()
|
||||
</code></pre></div></code></pre>
|
||||
<p>:::</p>
|
||||
"
|
||||
`;
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ function initFs() {
|
||||
[path.join(grammarsPath, 'grammars/go.json')]: '{ "language": "go" }',
|
||||
[path.join(grammarsPath, 'grammars/kotlin.json')]: '{ "language": "kotlin" }',
|
||||
[path.join(grammarsPath, 'grammars/rust.json')]: '{ "language": "rust" }',
|
||||
[path.join(grammarsPath, 'grammars/python.json')]: '{ "language": "python" }',
|
||||
})
|
||||
}
|
||||
|
||||
@ -101,6 +102,29 @@ const a = 1
|
||||
${FENCE}
|
||||
:::
|
||||
|
||||
::: python-repl
|
||||
${FENCE}python
|
||||
hello_world()
|
||||
${FENCE}
|
||||
:::
|
||||
|
||||
::: python-repl editable
|
||||
${FENCE}python
|
||||
hello_world()
|
||||
${FENCE}
|
||||
:::
|
||||
|
||||
::: python-repl title="title"
|
||||
${FENCE}python
|
||||
hello_world()
|
||||
${FENCE}
|
||||
:::
|
||||
|
||||
::: python-repl editable title="title"
|
||||
${FENCE}python
|
||||
hello_world()
|
||||
${FENCE}
|
||||
:::
|
||||
`
|
||||
it('should work with default options', async () => {
|
||||
initFs()
|
||||
@ -117,6 +141,7 @@ ${FENCE}
|
||||
go: true,
|
||||
kotlin: true,
|
||||
rust: true,
|
||||
python: true,
|
||||
})
|
||||
|
||||
expect(md.render(code)).toMatchSnapshot()
|
||||
@ -130,6 +155,7 @@ ${FENCE}
|
||||
go: true,
|
||||
kotlin: true,
|
||||
rust: true,
|
||||
python: true,
|
||||
theme: 'vitesse-light',
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user