Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillrogovoy authored and Benjmhart committed Jan 20, 2019
1 parent 7c0d812 commit ed6c6cf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,3 +1,5 @@
# heading1

content content content

[image](./100x100.png)
33 changes: 33 additions & 0 deletions packages/core/integration-tests/test/markdown.js
@@ -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));
}
}
});
});

0 comments on commit ed6c6cf

Please sign in to comment.