Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c0d812
commit ed6c6cf
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+255 Bytes
packages/core/integration-tests/test/integration/markdown/100x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
packages/core/integration-tests/test/integration/markdown/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# heading1 | ||
|
||
content content content | ||
|
||
[image](./100x100.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const assert = require('assert'); | ||
const path = require('path'); | ||
const fs = require('@parcel/fs'); | ||
const {bundle, run, assertBundleTree} = require('./utils'); | ||
|
||
describe('markdown', function() { | ||
it('should support bundling Markdown', async function() { | ||
let b = await bundle( | ||
path.join(__dirname, '/integration/markdown/index.md') | ||
); | ||
|
||
await assertBundleTree(b, { | ||
name: 'index.html', | ||
assets: ['index.md'], | ||
childBundles: [ | ||
{ | ||
type: 'png', | ||
assets: ['100x100.png'], | ||
childBundles: [] | ||
} | ||
] | ||
}); | ||
|
||
let files = await fs.readdir(path.join(__dirname, '/dist')); | ||
let html = await fs.readFile(path.join(__dirname, '/dist/index.html')); | ||
for (let file of files) { | ||
let ext = file.match(/\.([0-9a-z]+)(?:[?#]|$)/i)[0]; | ||
if (file !== 'index.html' && ext !== '.map') { | ||
assert(html.includes(file)); | ||
} | ||
} | ||
}); | ||
}); |