diff options
Diffstat (limited to 'packages/markdown/remark/test/remark-collect-images.test.js')
-rw-r--r-- | packages/markdown/remark/test/remark-collect-images.test.js | 52 |
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 `, { - fileURL: 'file.md', - }); + it('should collect inline image paths', async () => { + const { + code, + metadata: { imagePaths }, + } = await processor.render(`Hello `, { + fileURL: 'file.md', + }); - chai - .expect(code) - .to.equal('<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.png","alt":"inline image url","index":0}"></p>'); + chai + .expect(code) + .to.equal( + '<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.png","alt":"inline image url","index":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_="{"src":"./img.webp","alt":"image ref","index":0}"></p>'); - chai.expect(Array.from(imagePaths)).to.deep.equal(['./img.webp']); - }); + chai + .expect(code) + .to.equal( + '<p>Hello <img __ASTRO_IMAGE_="{"src":"./img.webp","alt":"image ref","index":0}"></p>' + ); + chai.expect(Array.from(imagePaths)).to.deep.equal(['./img.webp']); + }); }); |