Skip to content

Commit

Permalink
Replace dev-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 17, 2024
1 parent c98dfe9 commit 1eea808
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"hastscript": "^9.0.0",
"jsdom": "^25.0.0",
"prettier": "^3.0.0",
"rehype-highlight": "^7.0.0",
"rehype-parse": "^9.0.0",
"rehype-slug": "^6.0.0",
"rehype-starry-night": "^2.0.0",
"rehype-stringify": "^10.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
Expand Down
21 changes: 11 additions & 10 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {JSDOM} from 'jsdom'
import {rehypeDom} from 'rehype-dom'
import rehypeDomParse from 'rehype-dom-parse'
import rehypeDomStringify from 'rehype-dom-stringify'
import rehypeHighlight from 'rehype-highlight'
import rehypeStarryNight from 'rehype-starry-night'
import rehypeParse from 'rehype-parse'
import rehypeSlug from 'rehype-slug'
import rehypeStringify from 'rehype-stringify'
Expand Down Expand Up @@ -287,19 +287,20 @@ test('rehype-dom', async function (t) {
)
})

await t.test('should work w/ `rehype-highlight`', async function () {
await t.test('should work w/ `rehype-starry-night`', async function () {
assert.equal(
rehypeDom()
.use(rehypeHighlight)
.processSync(
`<h1>Hello World!</h1>
String(
await rehypeDom()
.use(rehypeStarryNight)
.process(
`<h1>Hello World!</h1>
<pre><code class="language-js">var name = "World";
console.warn("Hello, " + name + "!")</pre></code>`
)
.toString(),
)
),
`<h1>Hello World!</h1>
<pre><code class="hljs language-js"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">warn</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>`
<pre><code class="language-js"><span class="pl-k">var</span> name <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>World<span class="pl-pds">"</span></span>;
<span class="pl-en">console</span>.<span class="pl-c1">warn</span>(<span class="pl-s"><span class="pl-pds">"</span>Hello, <span class="pl-pds">"</span></span> <span class="pl-k">+</span> name <span class="pl-k">+</span> <span class="pl-s"><span class="pl-pds">"</span>!<span class="pl-pds">"</span></span>)</code></pre>`
)
})

Expand Down

0 comments on commit 1eea808

Please sign in to comment.