Skip to content

Commit

Permalink
build(deps-dev): update posthtml-include to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jul 25, 2024
1 parent 907de89 commit 3d168d4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
},
"scripts": {
"dev": "vitest",
"release": "npm run changelog && npx np",
"docs": "node ./docs-src",
"lint": "biome lint ./src ./scripts",
"test": "vitest run --coverage",
"lint": "biome lint ./src ./scripts",
"release": "npm run changelog && npx np",
"changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'chore: update changelog.md' && git push"
},
"keywords": [
Expand Down Expand Up @@ -43,7 +43,7 @@
"markdown-it-include": "^2.0.0",
"markdown-it-toc-done-right": "^4.2.0",
"posthtml-beautify": "^0.7.0",
"posthtml-include": "^1.7.4",
"posthtml-include": "^2.0.1",
"posthtml-markdownit": "^3.1.0",
"vitest": "^2.0.4"
}
Expand Down
15 changes: 14 additions & 1 deletion test/test-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,20 @@ test('Must include file using posthtml-include', async () => {
const actual = `<component src="components/component-with-include.html"></component>`;
const expected = `<div><p>Included file</p></div>`;

const html = await posthtml([plugin({root: './test/templates', tag: 'component', attribute: 'src', plugins: [require('posthtml-include')({root: './test/templates', encoding: 'utf8'})]})]).process(actual).then(result => clean(result.html));
const html = await posthtml([
plugin({
root: './test/templates',
tag: 'component',
attribute: 'src',
plugins: [
require('posthtml-include')({
root: './test/templates',
cwd: './test/templates',
encoding: 'utf8'
})
]
})
]).process(actual).then(result => clean(result.html));

expect(html).toBe(expected);
});

0 comments on commit 3d168d4

Please sign in to comment.