Skip to content

Commit 1890530

Browse files
chore(deps): update dependency happy-dom to v16 (#905)
* chore(deps): update dependency happy-dom to v16 * Improve test --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ivan Demchuk <ivan.demchuk@gmail.com>
1 parent 6b0e33f commit 1890530

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

__tests__/vue/noDom.spec.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,23 @@ describe('component html support', () => {
8383
expect(mounted.html()).toMatchInlineSnapshot('"<span>Hello \u{2068}John\u{2069}<br>How are you?</span>"')
8484
})
8585

86-
it('warn about not support markup', () => {
86+
it('warn about not supported markup', () => {
8787
// Arrange
8888
const bundle = new FluentBundle('en-US')
8989
bundle.addResource(
9090
new FluentResource(ftl`
91-
key = Hello {$name}<br>How are you?<!-- this is a comment -->
91+
key = Hello {$name}<br>How are you?
9292
`),
9393
)
9494

9595
const fluent = createFluentVue({
9696
bundles: [bundle],
9797
parseMarkup: (markup: string) => {
98-
const window = new Window()
99-
const parser = new window.DOMParser()
100-
const doc = parser.parseFromString(markup, 'text/html')
101-
const nodes = Array.from(doc.body.childNodes)
102-
103-
return nodes
98+
return [{
99+
nodeType: 8,
100+
textContent: markup,
101+
nodeValue: markup,
102+
}]
104103
},
105104
})
106105

@@ -120,7 +119,7 @@ describe('component html support', () => {
120119
const mounted = mountWithFluent(fluent, component)
121120

122121
// Assert
123-
expect(mounted.html()).toMatchInlineSnapshot('"<span>Hello \u{2068}John\u{2069}<br>How are you?</span>"')
122+
expect(mounted.html()).toMatchInlineSnapshot('"<span></span>"')
124123
expect(warn).toHaveBeenCalledWith('[fluent-vue] Unsupported node type: 8. If you need support for it, please, create an issue in fluent-vue repository.')
125124

126125
// Cleanup

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"esbuild-plugin-globals": "^0.2.0",
8585
"eslint": "^9.18.0",
8686
"execa": "^9.3.1",
87-
"happy-dom": "^15.6.0",
87+
"happy-dom": "^16.7.2",
8888
"husky": "^9.1.5",
8989
"lint-staged": "^15.2.9",
9090
"release-it": "*",

pnpm-lock.yaml

Lines changed: 16 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy