summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/test/remark-collect-images.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/test/remark-collect-images.test.js')
-rw-r--r--packages/markdown/remark/test/remark-collect-images.test.js52
1 files changed, 29 insertions, 23 deletions
diff --git a/packages/markdown/remark/test/remark-collect-images.test.js b/packages/markdown/remark/test/remark-collect-images.test.js
index 5aed711b0..259bea96e 100644
--- a/packages/markdown/remark/test/remark-collect-images.test.js
+++ b/packages/markdown/remark/test/remark-collect-images.test.js
@@ -2,32 +2,38 @@ import { createMarkdownProcessor } from '../dist/index.js';
import chai from 'chai';
describe('collect images', async () => {
- const processor = await createMarkdownProcessor();
+ const processor = await createMarkdownProcessor();
- it('should collect inline image paths', async () => {
- const {
- code,
- metadata: { imagePaths },
- } = await processor.render(`Hello ![inline image url](./img.png)`, {
- fileURL: 'file.md',
- });
+ it('should collect inline image paths', async () => {
+ const {
+ code,
+ metadata: { imagePaths },
+ } = await processor.render(`Hello ![inline image url](./img.png)`, {
+ fileURL: 'file.md',
+ });
- chai
- .expect(code)
- .to.equal('<p>Hello <img __ASTRO_IMAGE_="{&#x22;src&#x22;:&#x22;./img.png&#x22;,&#x22;alt&#x22;:&#x22;inline image url&#x22;,&#x22;index&#x22;:0}"></p>');
+ chai
+ .expect(code)
+ .to.equal(
+ '<p>Hello <img __ASTRO_IMAGE_="{&#x22;src&#x22;:&#x22;./img.png&#x22;,&#x22;alt&#x22;:&#x22;inline image url&#x22;,&#x22;index&#x22;:0}"></p>'
+ );
- chai.expect(Array.from(imagePaths)).to.deep.equal(['./img.png']);
- });
+ chai.expect(Array.from(imagePaths)).to.deep.equal(['./img.png']);
+ });
- it('should add image paths from definition', async () => {
- const {
- code,
- metadata: { imagePaths },
- } = await processor.render(`Hello ![image ref][img-ref]\n\n[img-ref]: ./img.webp`, {
- fileURL: 'file.md',
- });
+ it('should add image paths from definition', async () => {
+ const {
+ code,
+ metadata: { imagePaths },
+ } = await processor.render(`Hello ![image ref][img-ref]\n\n[img-ref]: ./img.webp`, {
+ fileURL: 'file.md',
+ });
- chai.expect(code).to.equal('<p>Hello <img __ASTRO_IMAGE_="{&#x22;src&#x22;:&#x22;./img.webp&#x22;,&#x22;alt&#x22;:&#x22;image ref&#x22;,&#x22;index&#x22;:0}"></p>');
- chai.expect(Array.from(imagePaths)).to.deep.equal(['./img.webp']);
- });
+ chai
+ .expect(code)
+ .to.equal(
+ '<p>Hello <img __ASTRO_IMAGE_="{&#x22;src&#x22;:&#x22;./img.webp&#x22;,&#x22;alt&#x22;:&#x22;image ref&#x22;,&#x22;index&#x22;:0}"></p>'
+ );
+ chai.expect(Array.from(imagePaths)).to.deep.equal(['./img.webp']);
+ });
});