]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip(vitest-migration): shared tests passing
authorEvan You <yyx990803@gmail.com>
Thu, 26 Jan 2023 07:31:52 +0000 (15:31 +0800)
committerEvan You <yyx990803@gmail.com>
Thu, 26 Jan 2023 07:31:52 +0000 (15:31 +0800)
packages/shared/__tests__/__snapshots__/codeframe.spec.ts.snap
packages/shared/__tests__/looseEqual.spec.ts
packages/shared/__tests__/toDisplayString.spec.ts

index a66fac9209deba40a4e0350d8bfe0773bb487869..4a50d62bc9b93885fd09ce390a32659ea50bfce4 100644 (file)
@@ -1,62 +1,62 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
+// Vitest Snapshot v1
 
-exports[`compiler: codeframe line in middle 1`] = `
-"2  |    <template key="one"></template>
+exports[`compiler: codeframe line in middle 1`] = `
+"2  |    <template key=\\"one\\"></template>
 3  |    <ul>
-4  |      <li v-for="foobar">hi</li>
+4  |      <li v-for=\\"foobar\\">hi</li>
    |          ^^^^^^^^^^^^^^
 5  |    </ul>
-6  |    <template key="two"></template>"
+6  |    <template key=\\"two\\"></template>"
 `;
 
-exports[`compiler: codeframe line near bottom 1`] = `
-"4  |      <li v-for="foobar">hi</li>
+exports[`compiler: codeframe line near bottom 1`] = `
+"4  |      <li v-for=\\"foobar\\">hi</li>
 5  |    </ul>
-6  |    <template key="two"></template>
+6  |    <template key=\\"two\\"></template>
    |              ^^^^^^^^^
 7  |  </div>"
 `;
 
-exports[`compiler: codeframe line near top 1`] = `
+exports[`compiler: codeframe line near top 1`] = `
 "1  |  <div>
-2  |    <template key="one"></template>
+2  |    <template key=\\"one\\"></template>
    |              ^^^^^^^^^
 3  |    <ul>
-4  |      <li v-for="foobar">hi</li>"
+4  |      <li v-for=\\"foobar\\">hi</li>"
 `;
 
-exports[`compiler: codeframe multi-line highlights 1`] = `
-"1  |  <div attr="some
+exports[`compiler: codeframe multi-line highlights 1`] = `
+"1  |  <div attr=\\"some
    |       ^^^^^^^^^^
 2  |    multiline
    |  ^^^^^^^^^^^
 3  |  attr
    |  ^^^^
-4  |  ">
+4  |  \\">
    |  ^"
 `;
 
-exports[`compiler: codeframe newline sequences - unix 1`] = `
-"8  |          <input name="email" type="text"/>
+exports[`compiler: codeframe newline sequences - unix 1`] = `
+"8  |          <input name=\\"email\\" type=\\"text\\"/>
 9  |        </div>
-10 |        <div id="hook">
+10 |        <div id=\\"hook\\">
    |        ^^^^^^^^^^^^^^^
-11 |          <label for="password">Password</label>
+11 |          <label for=\\"password\\">Password</label>
    |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-12 |          <input name="password" type="password"/>
+12 |          <input name=\\"password\\" type=\\"password\\"/>
    |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 13 |        </div>
    |  ^^^^^^^^^^^^"
 `;
 
-exports[`compiler: codeframe newline sequences - windows 1`] = `
-"8  |          <input name="email" type="text"/>
+exports[`compiler: codeframe newline sequences - windows 1`] = `
+"8  |          <input name=\\"email\\" type=\\"text\\"/>
 9  |        </div>
-10 |        <div id="hook">
+10 |        <div id=\\"hook\\">
    |        ^^^^^^^^^^^^^^^
-11 |          <label for="password">Password</label>
+11 |          <label for=\\"password\\">Password</label>
    |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-12 |          <input name="password" type="password"/>
+12 |          <input name=\\"password\\" type=\\"password\\"/>
    |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 13 |        </div>
    |  ^^^^^^^^^^^^"
index 24bd48c1015996eb1150fed75b3046067638bb4f..67b69dd76d48314b3212f709bee779d419c76f21 100644 (file)
@@ -1,3 +1,6 @@
+/**
+ * @vitest-environment jsdom
+ */
 import { looseEqual } from '../src'
 
 describe('utils/looseEqual', () => {
index b556402f6b81397845208caf488c1573123211d3..5255c0e400bc52b73f0b5d34de99cbe23c8f5c02 100644 (file)
@@ -1,3 +1,6 @@
+/**
+ * @vitest-environment jsdom
+ */
 import { computed, ref } from '@vue/reactivity'
 import { toDisplayString } from '../src'
 
@@ -86,10 +89,10 @@ describe('toDisplayString', () => {
 
   test('native objects', () => {
     const div = document.createElement('div')
-    expect(toDisplayString(div)).toBe('[object HTMLDivElement]')
+    expect(toDisplayString(div)).toMatch('[object HTMLDivElement]')
     expect(toDisplayString({ div })).toMatchInlineSnapshot(`
       "{
-        "div": "[object HTMLDivElement]"
+        \\"div\\": \\"[object HTMLDivElement]\\"
       }"
     `)
   })
@@ -103,28 +106,28 @@ describe('toDisplayString', () => {
 
     expect(toDisplayString(m)).toMatchInlineSnapshot(`
       "{
-        "Map(2)": {
-          "1 =>": "foo",
-          "[object Object] =>": {
-            "foo": "bar",
-            "qux": 2
+        \\"Map(2)\\": {
+          \\"1 =>\\": \\"foo\\",
+          \\"[object Object] =>\\": {
+            \\"foo\\": \\"bar\\",
+            \\"qux\\": 2
           }
         }
       }"
     `)
     expect(toDisplayString(s)).toMatchInlineSnapshot(`
       "{
-        "Set(3)": [
+        \\"Set(3)\\": [
           1,
           {
-            "foo": "bar"
+            \\"foo\\": \\"bar\\"
           },
           {
-            "Map(2)": {
-              "1 =>": "foo",
-              "[object Object] =>": {
-                "foo": "bar",
-                "qux": 2
+            \\"Map(2)\\": {
+              \\"1 =>\\": \\"foo\\",
+              \\"[object Object] =>\\": {
+                \\"foo\\": \\"bar\\",
+                \\"qux\\": 2
               }
             }
           }
@@ -139,27 +142,27 @@ describe('toDisplayString', () => {
       })
     ).toMatchInlineSnapshot(`
       "{
-        "m": {
-          "Map(2)": {
-            "1 =>": "foo",
-            "[object Object] =>": {
-              "foo": "bar",
-              "qux": 2
+        \\"m\\": {
+          \\"Map(2)\\": {
+            \\"1 =>\\": \\"foo\\",
+            \\"[object Object] =>\\": {
+              \\"foo\\": \\"bar\\",
+              \\"qux\\": 2
             }
           }
         },
-        "s": {
-          "Set(3)": [
+        \\"s\\": {
+          \\"Set(3)\\": [
             1,
             {
-              "foo": "bar"
+              \\"foo\\": \\"bar\\"
             },
             {
-              "Map(2)": {
-                "1 =>": "foo",
-                "[object Object] =>": {
-                  "foo": "bar",
-                  "qux": 2
+              \\"Map(2)\\": {
+                \\"1 =>\\": \\"foo\\",
+                \\"[object Object] =>\\": {
+                  \\"foo\\": \\"bar\\",
+                  \\"qux\\": 2
                 }
               }
             }