Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue-test-utils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.4
Choose a base ref
...
head repository: vuejs/vue-test-utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev
Choose a head ref

Commits on Apr 21, 2021

  1. docs: Fix heading on WrapperArray contains (#1831)

    Hello, all the other properties are h2 while contains is an h3 and therefore doesn't show up in the sidebar.
    
    Cheers
    maurer2 authored Apr 21, 2021
    Copy the full SHA
    7413b37 View commit details
  2. fix #1824: trigger keyboard event regression (#1826)

    * fix(dom-event): fix key override in trigger events
    
    fix #1824
    
    * test(dom-event): test for trigger events with keys
    Ana Margarida Silva authored Apr 21, 2021
    Copy the full SHA
    b755c3a View commit details
  3. build(deps): bump ssri from 6.0.1 to 6.0.2 (#1830)

    Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
    - [Release notes](https://github.com/npm/ssri/releases)
    - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
    - [Commits](npm/ssri@v6.0.1...v6.0.2)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Apr 21, 2021
    Copy the full SHA
    a1b4d05 View commit details

Commits on Apr 30, 2021

  1. Copy the full SHA
    97fdf18 View commit details
  2. fix: correctly find functional components (#1835)

    * fix: correctly find functional components
    
    * test: skip test in <2.6
    lmiller1990 authored Apr 30, 2021
    Copy the full SHA
    c14d6fd View commit details

Commits on May 1, 2021

  1. chore: publish 1.2.0

    lmiller1990 committed May 1, 2021
    Copy the full SHA
    4e44fb8 View commit details
  2. v1.2.0

    lmiller1990 committed May 1, 2021
    Copy the full SHA
    fd167cd View commit details
  3. Copy the full SHA
    ab7f051 View commit details
  4. Copy the full SHA
    8fcfdce View commit details
  5. fix: remove flaky spec

    lmiller1990 committed May 1, 2021
    Copy the full SHA
    aeb5fd6 View commit details
  6. Copy the full SHA
    fa0322b View commit details
  7. Copy the full SHA
    642aed9 View commit details
  8. Copy the full SHA
    e5e3f3e View commit details
  9. Copy the full SHA
    632691d View commit details
  10. v1.2.0

    lmiller1990 committed May 1, 2021
    Copy the full SHA
    085bac2 View commit details

Commits on May 9, 2021

  1. Updated router link stub to match actual router-link interface (#1840)

    * Added new router link property, and updated docs
    
    * added exactPathActiveClass property to a router link stub
    Th3Un1q3 authored May 9, 2021
    Copy the full SHA
    d6b79c8 View commit details
  2. build(deps): bump lodash from 4.17.20 to 4.17.21 (#1843)

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.17.20...4.17.21)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 9, 2021
    Copy the full SHA
    3134d88 View commit details
  3. build(deps): bump handlebars from 4.7.6 to 4.7.7 (#1841)

    Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
    - [Release notes](https://github.com/wycats/handlebars.js/releases)
    - [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
    - [Commits](handlebars-lang/handlebars.js@v4.7.6...v4.7.7)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 9, 2021
    Copy the full SHA
    d11c41c View commit details
  4. Update testing-async-components.md (#1836)

    * Update testing-async-components.md
    
    * Update testing-async-components.md
    sergeyBreslavets authored May 9, 2021
    Copy the full SHA
    d55f8f1 View commit details

Commits on May 12, 2021

  1. build(deps): bump hosted-git-info from 2.8.5 to 2.8.9 (#1844)

    Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.5 to 2.8.9.
    - [Release notes](https://github.com/npm/hosted-git-info/releases)
    - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
    - [Commits](npm/hosted-git-info@v2.8.5...v2.8.9)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored May 12, 2021
    Copy the full SHA
    7e78174 View commit details

Commits on May 26, 2021

  1. docs(test-utils): add tip about using trigger('focus') (#1848)

    When using `trigger('focus')` with jsdom v16.4.0 and above you must
    use `attachTo` when mounting the component.
    
    Co-authored-by: peterhegman <phegman@gitlab.com>
    phegman and peterhegman authored May 26, 2021
    Copy the full SHA
    83aa823 View commit details

Commits on Jun 8, 2021

  1. docs: Update setProps.md (#1856)

    change 'could' to 'should'
    dyerjos authored Jun 8, 2021
    Copy the full SHA
    9efab90 View commit details

Commits on Jun 13, 2021

  1. fix: Updates attachToDocument documentation tip (#1852)

    Closes #1725
    
    Updates  attachToDocument documentation tip from the div boilerplate from #1584 & #1611 to the new handling from #1578 & #1699
    RaphaelDDL authored Jun 13, 2021
    Copy the full SHA
    9c05f2e View commit details
  2. Copy the full SHA
    b118dcd View commit details
  3. Copy the full SHA
    82370ab View commit details

Commits on Jun 14, 2021

  1. Copy the full SHA
    21f3ab1 View commit details
  2. chore: publish v1.2.1

    lmiller1990 committed Jun 14, 2021
    Copy the full SHA
    1999417 View commit details
  3. v1.2.1

    lmiller1990 committed Jun 14, 2021
    Copy the full SHA
    38072d5 View commit details
  4. Copy the full SHA
    a451289 View commit details

Commits on Jul 7, 2021

  1. build(deps): bump prismjs from 1.23.0 to 1.24.0 (#1866)

    Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0.
    - [Release notes](https://github.com/PrismJS/prism/releases)
    - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
    - [Commits](PrismJS/prism@v1.23.0...v1.24.0)
    
    ---
    updated-dependencies:
    - dependency-name: prismjs
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 7, 2021
    Copy the full SHA
    d7fcff0 View commit details

Commits on Jul 12, 2021

  1. feat: add generic for wrapper.find() and wrapper.get() (#1871)

    * feat: add generic for wrapper.find() and wrapper.get()
    
    * refactor: change HTMLElement -> Element
    
    * fix: fix the tests for wrapper
    
    * fix: forgot to apply the generic
    
    * test: added the simple test
    standbyoneself authored Jul 12, 2021
    Copy the full SHA
    c2ee13b View commit details
  2. fix: add options param to createLocalVue types (#1873)

    Co-authored-by: 陳 佳冬 <jiadong.chen@g.softbank.co.jp>
    coolboy0961 and 陳 佳冬 authored Jul 12, 2021
    Copy the full SHA
    9965f5f View commit details

Commits on Jul 22, 2021

  1. v1.2.2

    lmiller1990 committed Jul 22, 2021
    Copy the full SHA
    d56d945 View commit details

Commits on Aug 11, 2021

  1. build(deps): bump path-parse from 1.0.6 to 1.0.7 (#1893)

    Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
    - [Release notes](https://github.com/jbgutierrez/path-parse/releases)
    - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)
    
    ---
    updated-dependencies:
    - dependency-name: path-parse
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Aug 11, 2021
    Copy the full SHA
    c0d7f2b View commit details

Commits on Aug 27, 2021

  1. docs: fix zh links (#1890)

    wxsms authored Aug 27, 2021
    Copy the full SHA
    e639009 View commit details

Commits on Sep 6, 2021

  1. build(deps): bump tar from 4.4.13 to 4.4.19 (#1900)

    Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.19.
    - [Release notes](https://github.com/npm/node-tar/releases)
    - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
    - [Commits](isaacs/node-tar@v4.4.13...v4.4.19)
    
    ---
    updated-dependencies:
    - dependency-name: tar
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 6, 2021
    Copy the full SHA
    b420133 View commit details

Commits on Sep 24, 2021

  1. docs: Add french Version (#1837)

    * add french version
    
    * add more
    
    * update of the french version in relation to the feedback
    
    * docs: fix some errors in linting docs
    
    * fixed the sidebar and updated the README files in the Wrapper and Installation folders
    
    * update with prettier run
    
    Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
    phrobinet and lmiller1990 authored Sep 24, 2021
    Copy the full SHA
    60a3438 View commit details

Commits on Oct 29, 2021

  1. Update package.json to include the repository key (#1891)

    With the rise in supply chain attacks and OSS dependencies being used as a attack vector, Microsoft is working with our ecosystem partners, such as the Linux Foundation's OpenSSF, to enable OSS consumers to track packages back to their public sources.
    We've identified that the following packages published to NPM do not report where sources can be found, typically accomplished by including a link to your GitHub repository in your `package.json` REPOSITORY field. This PR was created to add this value, ensuring future releases will include this provenance information.
    Published NPM packages with repository information:
    * vue-test-utils
    msftenhanceprovenance authored Oct 29, 2021
    Copy the full SHA
    19c2a64 View commit details
  2. fix(test-utils): verify object not null for typeof (#1897)

    Using vue-test-utils may cause several messages of the sort
    ```
    [Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"
    ```
    
    Such messages stemmed from the `isComponentOptions` method call. It
    seems it received a null object and `typeof null` is object, so this
    error propagates to users of the library.
    
    This patch does not look for the reason a null object was sent in the
    first place, but it avoids the error propagation.
    
    close #1805
    ataias authored Oct 29, 2021
    Copy the full SHA
    dace7f1 View commit details
  3. Copy the full SHA
    fef4a50 View commit details
  4. Copy the full SHA
    3a5c779 View commit details
  5. docs: fix typo in zh docs (#1908)

    `setTimeout` callbacks are processed in macrotask queue which shoud be translated as '宏任务队列'
    OneMoreJack authored Oct 29, 2021
    Copy the full SHA
    c97d61d View commit details
  6. Copy the full SHA
    69b4c34 View commit details

Commits on Nov 9, 2021

  1. fix: restore chaining and CSS selectors for findComponent (#1910)

    Allow findComponent / findAllComponents to be chained from
    DOM selector and allow CSS selectors to be used
    xanf authored Nov 9, 2021
    Copy the full SHA
    a351831 View commit details

Commits on Nov 17, 2021

  1. chore: publish 1.3.0

    lmiller1990 committed Nov 17, 2021
    Copy the full SHA
    ad7b1c9 View commit details
  2. v1.3.0

    lmiller1990 committed Nov 17, 2021
    Copy the full SHA
    1060708 View commit details

Commits on Nov 29, 2021

  1. docs(zh): fix wording (#1912)

    kiccer authored Nov 29, 2021
    Copy the full SHA
    2563b48 View commit details
  2. Copy the full SHA
    f812920 View commit details

Commits on Nov 30, 2021

  1. Copy the full SHA
    b1ce2fe View commit details

Commits on Jan 22, 2022

  1. Copy the full SHA
    343cbcc View commit details
Showing with 24,784 additions and 1,149 deletions.
  1. +0 −12 .circleci/config.yml
  2. +1 −1 .eslintignore
  3. +0 −3 .github/CONTRIBUTING.md
  4. +1 −0 .gitignore
  5. +1 −1 .nvmrc
  6. +3 −1 .prettierrc.json
  7. +5 −5 README.md
  8. +84 −8 docs/.vuepress/config.js
  9. +1 −4 docs/.vuepress/theme/Layout.vue
  10. +1 −1 docs/README.md
  11. +1 −1 docs/api/components/RouterLinkStub.md
  12. +1 −1 docs/api/config.md
  13. +5 −8 docs/api/options.md
  14. +1 −1 docs/api/wrapper-array/contains.md
  15. +6 −2 docs/api/wrapper/findAllComponents.md
  16. +29 −1 docs/api/wrapper/findComponent.md
  17. +1 −1 docs/api/wrapper/setProps.md
  18. +4 −0 docs/api/wrapper/trigger.md
  19. +90 −0 docs/fr/README.md
  20. +11 −0 docs/fr/api/README.md
  21. +4 −0 docs/fr/api/components/README.md
  22. +20 −0 docs/fr/api/components/RouterLinkStub.md
  23. +114 −0 docs/fr/api/config.md
  24. +59 −0 docs/fr/api/createLocalVue.md
  25. +25 −0 docs/fr/api/createWrapper.md
  26. +25 −0 docs/fr/api/enableAutoDestroy.md
  27. +137 −0 docs/fr/api/mount.md
  28. +475 −0 docs/fr/api/options.md
  29. +103 −0 docs/fr/api/render.md
  30. +101 −0 docs/fr/api/renderToString.md
  31. +60 −0 docs/fr/api/selectors.md
  32. +118 −0 docs/fr/api/shallowMount.md
  33. +29 −0 docs/fr/api/wrapper-array/README.md
  34. +26 −0 docs/fr/api/wrapper-array/at.md
  35. +24 −0 docs/fr/api/wrapper-array/contains.md
  36. +16 −0 docs/fr/api/wrapper-array/destroy.md
  37. +18 −0 docs/fr/api/wrapper-array/exists.md
  38. +25 −0 docs/fr/api/wrapper-array/filter.md
  39. +37 −0 docs/fr/api/wrapper-array/is.md
  40. +24 −0 docs/fr/api/wrapper-array/isEmpty.md
  41. +21 −0 docs/fr/api/wrapper-array/isVisible.md
  42. +25 −0 docs/fr/api/wrapper-array/isVueInstance.md
  43. +39 −0 docs/fr/api/wrapper-array/setChecked.md
  44. +22 −0 docs/fr/api/wrapper-array/setData.md
  45. +36 −0 docs/fr/api/wrapper-array/setMethods.md
  46. +22 −0 docs/fr/api/wrapper-array/setProps.md
  47. +38 −0 docs/fr/api/wrapper-array/setValue.md
  48. +27 −0 docs/fr/api/wrapper-array/trigger.md
  49. +57 −0 docs/fr/api/wrapper/README.md
  50. +20 −0 docs/fr/api/wrapper/attributes.md
  51. +22 −0 docs/fr/api/wrapper/classes.md
  52. +27 −0 docs/fr/api/wrapper/contains.md
  53. +23 −0 docs/fr/api/wrapper/destroy.md
  54. +61 −0 docs/fr/api/wrapper/emitted.md
  55. +33 −0 docs/fr/api/wrapper/emittedByOrder.md
  56. +20 −0 docs/fr/api/wrapper/exists.md
  57. +43 −0 docs/fr/api/wrapper/find.md
  58. +32 −0 docs/fr/api/wrapper/findAll.md
  59. +23 −0 docs/fr/api/wrapper/findAllComponents.md
  60. +26 −0 docs/fr/api/wrapper/findComponent.md
  61. +23 −0 docs/fr/api/wrapper/get.md
  62. +25 −0 docs/fr/api/wrapper/getComponent.md
  63. +15 −0 docs/fr/api/wrapper/html.md
  64. +36 −0 docs/fr/api/wrapper/is.md
  65. +23 −0 docs/fr/api/wrapper/isEmpty.md
  66. +20 −0 docs/fr/api/wrapper/isVisible.md
  67. +23 −0 docs/fr/api/wrapper/isVueInstance.md
  68. +21 −0 docs/fr/api/wrapper/name.md
  69. +47 −0 docs/fr/api/wrapper/overview.md
  70. +26 −0 docs/fr/api/wrapper/props.md
  71. +30 −0 docs/fr/api/wrapper/setChecked.md
  72. +22 −0 docs/fr/api/wrapper/setData.md
  73. +34 −0 docs/fr/api/wrapper/setMethods.md
  74. +53 −0 docs/fr/api/wrapper/setProps.md
  75. +26 −0 docs/fr/api/wrapper/setSelected.md
  76. +42 −0 docs/fr/api/wrapper/setValue.md
  77. +15 −0 docs/fr/api/wrapper/text.md
  78. +53 −0 docs/fr/api/wrapper/trigger.md
  79. +9 −0 docs/fr/guides/README.md
  80. +343 −0 docs/fr/guides/common-tips.md
  81. +217 −0 docs/fr/guides/dom-events.md
  82. +76 −0 docs/fr/guides/getting-started.md
  83. +143 −0 docs/fr/guides/testing-async-components.md
  84. +21 −0 docs/fr/guides/useful-libraries-for-testing.md
  85. +157 −0 docs/fr/guides/using-with-typescript.md
  86. +83 −0 docs/fr/guides/using-with-vue-router.md
  87. +392 −0 docs/fr/guides/using-with-vuex.md
  88. +5 −0 docs/fr/installation/README.md
  89. +3 −0 docs/fr/installation/semantic-versioning.md
  90. +60 −0 docs/fr/installation/using-other-test-runners.md
  91. +119 −0 docs/fr/installation/using-with-jest.md
  92. +2 −2 docs/guides/common-tips.md
  93. +1 −1 docs/guides/dom-events.md
  94. +1 −1 docs/installation/using-other-test-runners.md
  95. +2 −2 docs/installation/using-with-jest.md
  96. +1 −1 docs/ja/api/components/RouterLinkStub.md
  97. +1 −1 docs/ja/api/options.md
  98. +14 −0 docs/ja/api/wrapper-array/is.md
  99. +4 −0 docs/ja/guides/common-tips.md
  100. +1 −1 docs/ja/guides/dom-events.md
  101. +1 −1 docs/ja/guides/getting-started.md
  102. +2 −2 docs/ja/installation/testing-single-file-components-with-karma.md
  103. +93 −0 docs/pt/README.md
  104. +11 −0 docs/pt/api/README.md
  105. +5 −0 docs/pt/api/components/README.md
  106. +20 −0 docs/pt/api/components/RouterLinkStub.md
  107. +114 −0 docs/pt/api/config.md
  108. +59 −0 docs/pt/api/createLocalVue.md
  109. +25 −0 docs/pt/api/createWrapper.md
  110. +55 −0 docs/pt/api/enableAutoDestroy.md
  111. +137 −0 docs/pt/api/mount.md
  112. +471 −0 docs/pt/api/options.md
  113. +103 −0 docs/pt/api/render.md
  114. +101 −0 docs/pt/api/renderToString.md
  115. +61 −0 docs/pt/api/selectors.md
  116. +118 −0 docs/pt/api/shallowMount.md
  117. +30 −0 docs/pt/api/wrapper-array/README.md
  118. +26 −0 docs/pt/api/wrapper-array/at.md
  119. +24 −0 docs/pt/api/wrapper-array/contains.md
  120. +16 −0 docs/pt/api/wrapper-array/destroy.md
  121. +18 −0 docs/pt/api/wrapper-array/exists.md
  122. +26 −0 docs/pt/api/wrapper-array/filter.md
  123. +20 −0 docs/pt/api/wrapper-array/is.md
  124. +24 −0 docs/pt/api/wrapper-array/isEmpty.md
  125. +21 −0 docs/pt/api/wrapper-array/isVisible.md
  126. +25 −0 docs/pt/api/wrapper-array/isVueInstance.md
  127. +41 −0 docs/pt/api/wrapper-array/setChecked.md
  128. +24 −0 docs/pt/api/wrapper-array/setData.md
  129. +36 −0 docs/pt/api/wrapper-array/setMethods.md
  130. +24 −0 docs/pt/api/wrapper-array/setProps.md
  131. +40 −0 docs/pt/api/wrapper-array/setValue.md
  132. +29 −0 docs/pt/api/wrapper-array/trigger.md
  133. +57 −0 docs/pt/api/wrapper/README.md
  134. +20 −0 docs/pt/api/wrapper/attributes.md
  135. +22 −0 docs/pt/api/wrapper/classes.md
  136. +27 −0 docs/pt/api/wrapper/contains.md
  137. +23 −0 docs/pt/api/wrapper/destroy.md
  138. +61 −0 docs/pt/api/wrapper/emitted.md
  139. +34 −0 docs/pt/api/wrapper/emittedByOrder.md
  140. +18 −0 docs/pt/api/wrapper/exists.md
  141. +43 −0 docs/pt/api/wrapper/find.md
  142. +32 −0 docs/pt/api/wrapper/findAll.md
  143. +27 −0 docs/pt/api/wrapper/findAllComponents.md
  144. +54 −0 docs/pt/api/wrapper/findComponent.md
  145. +24 −0 docs/pt/api/wrapper/get.md
  146. +24 −0 docs/pt/api/wrapper/getComponent.md
  147. +16 −0 docs/pt/api/wrapper/html.md
  148. +36 −0 docs/pt/api/wrapper/is.md
  149. +23 −0 docs/pt/api/wrapper/isEmpty.md
  150. +20 −0 docs/pt/api/wrapper/isVisible.md
  151. +23 −0 docs/pt/api/wrapper/isVueInstance.md
  152. +21 −0 docs/pt/api/wrapper/name.md
  153. +47 −0 docs/pt/api/wrapper/overview.md
  154. +26 −0 docs/pt/api/wrapper/props.md
  155. +35 −0 docs/pt/api/wrapper/setChecked.md
  156. +26 −0 docs/pt/api/wrapper/setData.md
  157. +34 −0 docs/pt/api/wrapper/setMethods.md
  158. +53 −0 docs/pt/api/wrapper/setProps.md
  159. +31 −0 docs/pt/api/wrapper/setSelected.md
  160. +53 −0 docs/pt/api/wrapper/setValue.md
  161. +15 −0 docs/pt/api/wrapper/text.md
  162. +57 −0 docs/pt/api/wrapper/trigger.md
  163. +9 −0 docs/pt/guides/README.md
  164. +345 −0 docs/pt/guides/common-tips.md
  165. +215 −0 docs/pt/guides/dom-events.md
  166. +76 −0 docs/pt/guides/getting-started.md
  167. +143 −0 docs/pt/guides/testing-async-components.md
  168. +21 −0 docs/pt/guides/useful-libraries-for-testing.md
  169. +157 −0 docs/pt/guides/using-with-typescript.md
  170. +86 −0 docs/pt/guides/using-with-vue-router.md
  171. +393 −0 docs/pt/guides/using-with-vuex.md
  172. +5 −0 docs/pt/installation/README.md
  173. +3 −0 docs/pt/installation/semantic-versioning.md
  174. +60 −0 docs/pt/installation/using-other-test-runners.md
  175. +119 −0 docs/pt/installation/using-with-jest.md
  176. +84 −0 docs/pt/upgrading-to-v1/README.md
  177. +1 −1 docs/ru/README.md
  178. +1 −1 docs/ru/api/components/RouterLinkStub.md
  179. +1 −1 docs/ru/api/options.md
  180. +1 −1 docs/ru/guides/dom-events.md
  181. +1 −1 docs/ru/guides/getting-started.md
  182. +3 −1 docs/ru/guides/testing-async-components.md
  183. +2 −2 docs/ru/installation/testing-single-file-components-with-karma.md
  184. +1 −1 docs/zh/README.md
  185. +1 −1 docs/zh/api/components/RouterLinkStub.md
  186. +1 −1 docs/zh/api/mount.md
  187. +1 −1 docs/zh/api/options.md
  188. +4 −4 docs/zh/api/render.md
  189. +14 −0 docs/zh/api/wrapper-array/is.md
  190. +28 −28 docs/zh/api/wrapper/README.md
  191. +1 −1 docs/zh/api/wrapper/emitted.md
  192. +1 −1 docs/zh/api/wrapper/findAllComponents.md
  193. +1 −1 docs/zh/api/wrapper/setSelected.md
  194. +1 −1 docs/zh/guides/common-tips.md
  195. +1 −1 docs/zh/guides/dom-events.md
  196. +1 −1 docs/zh/guides/getting-started.md
  197. +1 −1 docs/zh/guides/testing-async-components.md
  198. +1 −1 docs/zh/installation/testing-single-file-components-with-jest.md
  199. +2 −2 docs/zh/installation/testing-single-file-components-with-karma.md
  200. +1 −1 lerna.json
  201. +7 −3 package.json
  202. +2 −2 packages/create-instance/add-mocks.js
  203. +40 −19 packages/create-instance/create-component-stubs.js
  204. +6 −5 packages/create-instance/create-instance.js
  205. +4 −4 packages/create-instance/create-scoped-slots.js
  206. +1 −1 packages/create-instance/log-events.js
  207. +1 −1 packages/create-instance/package.json
  208. +9 −1 packages/create-instance/patch-create-element.js
  209. +139 −104 packages/server-test-utils/dist/vue-server-test-utils.js
  210. +1 −1 packages/server-test-utils/package.json
  211. +3 −3 packages/shared/compile-template.js
  212. +2 −1 packages/shared/create-local-vue.js
  213. +12 −1 packages/shared/is-visible.js
  214. +3 −3 packages/shared/merge-options.js
  215. +1 −1 packages/shared/package.json
  216. +4 −0 packages/shared/util.js
  217. +2 −2 packages/shared/validate-slots.js
  218. +8 −8 packages/shared/validators.js
  219. +14,142 −0 packages/test-utils/dist/vue-test-utils.esm.js
  220. +141 −104 packages/test-utils/dist/vue-test-utils.iife.js
  221. +141 −104 packages/test-utils/dist/vue-test-utils.js
  222. +141 −104 packages/test-utils/dist/vue-test-utils.umd.js
  223. +10 −1 packages/test-utils/package.json
  224. +9 −0 packages/test-utils/scripts/build.js
  225. +2 −0 packages/test-utils/src/components/RouterLinkStub.js
  226. +7 −6 packages/test-utils/src/create-dom-event.js
  227. +16 −5 packages/test-utils/src/matches.js
  228. +3 −2 packages/test-utils/src/recursively-set-data.js
  229. +1 −1 packages/test-utils/src/wrapper-array.js
  230. +36 −53 packages/test-utils/src/wrapper.js
  231. +10 −8 packages/test-utils/types/index.d.ts
  232. +3 −1 packages/test-utils/types/test/wrapper.ts
  233. BIN packages/vue2 - Raccourci.lnk
  234. +2 −5 test/resources/components/component-with-computed.vue
  235. +12 −0 test/resources/components/component-with-name-prop.vue
  236. +1 −3 test/resources/components/component-with-transitions.vue
  237. +1 −1 test/resources/components/component-with-watch-immediate.vue
  238. +1 −1 test/resources/components/component-with-watch.vue
  239. +1 −1 test/resources/test-mixin.js
  240. +4 −4 test/resources/utils.js
  241. +8 −2 test/specs/components/RouterLink.spec.js
  242. +30 −35 test/specs/create-local-vue.spec.js
  243. +3 −3 test/specs/mount.spec.js
  244. +6 −7 test/specs/mounting-options/scopedSlots.spec.js
  245. +151 −0 test/specs/mounting-options/stubs.spec.js
  246. +34 −2 test/specs/shallow-mount.spec.js
  247. +7 −13 test/specs/wrapper-array/at.spec.js
  248. +1 −3 test/specs/wrapper-array/attributes.spec.js
  249. +1 −3 test/specs/wrapper-array/classes.spec.js
  250. +4 −4 test/specs/wrapper-array/contains.spec.js
  251. +3 −5 test/specs/wrapper-array/find.spec.js
  252. +3 −5 test/specs/wrapper-array/findAll.spec.js
  253. +3 −5 test/specs/wrapper-array/html.spec.js
  254. +1 −4 test/specs/wrapper-array/is.spec.js
  255. +1 −4 test/specs/wrapper-array/isEmpty.spec.js
  256. +1 −4 test/specs/wrapper-array/isVisible.spec.js
  257. +1 −4 test/specs/wrapper-array/isVueInstance.spec.js
  258. +1 −4 test/specs/wrapper-array/name.spec.js
  259. +3 −5 test/specs/wrapper-array/props.spec.js
  260. +1 −4 test/specs/wrapper-array/setData.spec.js
  261. +1 −4 test/specs/wrapper-array/setProps.spec.js
  262. +1 −4 test/specs/wrapper-array/text.spec.js
  263. +1 −4 test/specs/wrapper-array/trigger.spec.js
  264. +3 −3 test/specs/wrapper/emittedByOrder.spec.js
  265. +94 −28 test/specs/wrapper/find.spec.js
  266. +38 −12 test/specs/wrapper/findAll.spec.js
  267. +15 −0 test/specs/wrapper/isVisible.spec.js
  268. +6 −2 test/specs/wrapper/overview.spec.js
  269. +1 −3 test/specs/wrapper/props.spec.js
  270. +2 −5 test/specs/wrapper/setData.spec.js
  271. +5 −8 test/specs/wrapper/setProps.spec.js
  272. +1 −1 test/specs/wrapper/setValue.spec.js
  273. +19 −4 test/specs/wrapper/trigger.spec.js
  274. +344 −273 yarn.lock
12 changes: 0 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -60,13 +60,6 @@ jobs:
- run:
name: yarn test
command: yarn test
test_compat:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- *restore_node_modules
- run: yarn test:compat
workflows:
version: 2
install-tests:
@@ -81,8 +74,3 @@ workflows:
- test:
requires:
- install
- test_compat:
requires:
- install
- build_test
- test
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dist
**/dist/**
3 changes: 0 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -57,9 +57,6 @@ $ yarn test:unit

# run the full test suite, include linting / type checking
$ yarn test

# run tests against src files only. Allows inline debugging.
$ yarn test:unit:only:dev
```

There are some other scripts available in the `scripts` section of the `package.json` file.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules/
.eslintcache

# Editor files
/.idea
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10
v16
4 changes: 3 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"semi": false,
"singleQuote": true
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid"
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vue Test Utils [![Build Status](https://circleci.com/gh/vuejs/vue-test-utils/tree/dev.png?style=shield)](https://circleci.com/gh/vuejs/vue-test-utils)

Vue Test Utils is the official testing library for Vue.js.
Component testing utils for Vue 2.

## Packages

@@ -12,8 +12,8 @@ This repository provides the following two packages:
You can install these packages by the following command.

```
npm install --save-dev @vue/test-utils
npm install --save-dev @vue/server-test-utils
npm install --save-dev @vue/test-utils@1
npm install --save-dev @vue/server-test-utils@1
```

## Peer Dependencies
@@ -26,15 +26,15 @@ npm install --save-dev vue-template-compiler

## Documentation

Refer to the [documentation](https://vue-test-utils.vuejs.org/)
Refer to the [documentation](https://v1.test-utils.vuejs.org/)

## Questions

For questions and support please use the [Discord chat room](https://vue-land.js.org/) or [the official forum](http://forum.vuejs.org). The issue list of this repo is **exclusively** for bug reports and feature requests.

## Issues

Please make sure to read the [Issue Reporting Checklist](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
Please make sure to read the issue reporting requirements before opening an issue. Issues not conforming to the guidelines may be closed immediately.

## Contribution

92 changes: 84 additions & 8 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -19,6 +19,16 @@ module.exports = {
lang: 'ru',
title: 'Vue Test Utils',
description: 'Библиотека для тестирования Vue-компонентов'
},
'/fr/': {
title: 'Vue Test Utils',
lang: 'fr',
description: 'Utilitaires pour tester les composants Vue'
},
'/pt/': {
title: 'Vue Test Utils',
lang: 'pt',
description: 'Utilitários para testes de componentes de Vue'
}
},
plugins: ['@vuepress/pwa'],
@@ -54,8 +64,8 @@ module.exports = {
link: '/guides/',
items: [
{
text: '2.x-beta',
link: 'https://next.vue-test-utils.vuejs.org/guide/'
text: 'v2 (Vue.js 3)',
link: 'https://test-utils.vuejs.org/'
}
]
},
@@ -89,8 +99,8 @@ module.exports = {
link: '/zh/guides/',
items: [
{
text: '2.x-beta',
link: 'https://next.vue-test-utils.vuejs.org/guide/'
text: 'v2 (Vue.js 3)',
link: 'https://test-utils.vuejs.org/'
}
]
}
@@ -120,8 +130,8 @@ module.exports = {
link: '/ja/guides/',
items: [
{
text: '2.x-beta',
link: 'https://next.vue-test-utils.vuejs.org/guide/'
text: 'v2 (Vue.js 3)',
link: 'https://test-utils.vuejs.org/'
}
]
}
@@ -151,8 +161,8 @@ module.exports = {
link: '/ru/guides/',
items: [
{
text: '2.x-beta',
link: 'https://next.vue-test-utils.vuejs.org/guide/'
text: 'v2 (Vue.js 3)',
link: 'https://test-utils.vuejs.org/'
}
]
}
@@ -167,6 +177,72 @@ module.exports = {
'/ru/api/options',
'/ru/api/components/'
]
},
'/fr/': {
label: 'Français',
selectText: 'langue',
editLinkText: 'Modifier cette page sur GitHub',
nav: [
{
text: 'API',
link: '/fr/api/'
},
{
text: 'Guides',
link: '/fr/guides/',
items: [
{
text: 'v2 (Vue.js 3)',
link: 'https://test-utils.vuejs.org/'
}
]
}
],
sidebar: [
'/fr/',
'/fr/installation/',
'/fr/guides/',
'/fr/api/',
'/fr/api/wrapper/',
'/fr/api/wrapper-array/',
'/fr/api/options',
'/fr/api/components/'
]
},
'/pt/': {
label: 'Português',
selectText: 'Idiomas',
editLinkText: 'Edite esta página no GitHub',
nav: [
{
text: 'API',
link: '/pt/api/'
},
{
text: 'Guias',
link: '/pt/guides/',
items: [
{
text: '2.x-beta',
link: 'https://next.vue-test-utils.vuejs.org/guide/'
}
]
},
{
text: 'Atualizando para V1',
link: '/pt/upgrading-to-v1/'
}
],
sidebar: [
'/pt/',
'/pt/installation/',
'/pt/guides/',
'/pt/api/',
'/pt/api/wrapper/',
'/pt/api/wrapper-array/',
'/pt/api/options',
'/pt/api/components/'
]
}
}
},
5 changes: 1 addition & 4 deletions docs/.vuepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -9,10 +9,7 @@
</p>
<p>
To read docs for Vue Test Utils for Vue 3,
<a
href="https://next.vue-test-utils.vuejs.org/guide/"
v-text="'click here'"
/>.
<a href="https://test-utils.vuejs.org/" v-text="'click here'" />.
</p>
</div>
</div>
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ This is the documentation for Vue Test Utils v1, which targets Vue 2 and earlier
In short:

- [Vue Test Utils 1](https://github.com/vuejs/vue-test-utils/) targets [Vue 2](https://github.com/vuejs/vue/).
- [Vue Test Utils 2](https://github.com/vuejs/vue-test-utils-next/) targets [Vue 3](https://github.com/vuejs/vue-next/).
- [Vue Test Utils 2](https://github.com/vuejs/test-utils) targets [Vue 3](https://github.com/vuejs/core).

<div class="vueschool"><a href="https://vueschool.io/courses/learn-how-to-test-vuejs-components?friend=vuejs" target="_blank" rel="sponsored noopener" title="Learn how to use Vue Test Utils to test Vue.js Components with Vue School">Learn how to test Vue.js components with Vue School</a></div>

2 changes: 1 addition & 1 deletion docs/api/components/RouterLinkStub.md
Original file line number Diff line number Diff line change
@@ -16,5 +16,5 @@ const wrapper = mount(Component, {
RouterLink: RouterLinkStub
}
})
expect(wrapper.find(RouterLinkStub).props().to).toBe('/some/path')
expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/some/path')
```
2 changes: 1 addition & 1 deletion docs/api/config.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ config.showDeprecationWarnings = true
config.deprecationWarningHandler = (method, message) => {
if (method === 'emittedByOrder') return

console.error(msg)
console.error(message)
}
```

13 changes: 5 additions & 8 deletions docs/api/options.md
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ You can also pass a function that takes the props as an argument:
```js
shallowMount(Component, {
scopedSlots: {
foo: function(props) {
foo: function (props) {
return this.$createElement('div', props.index)
}
}
@@ -317,13 +317,13 @@ const Component = {
let wrapper = mount(Component, {
attachTo: '#root'
})
expect(wrapper.vm.$el.parentNode).to.not.be.null
expect(wrapper.vm.$el.parentNode).not.toBeNull()
wrapper.destroy()

wrapper = mount(Component, {
attachTo: document.getElementById('root')
})
expect(wrapper.vm.$el.parentNode).to.not.be.null
expect(wrapper.vm.$el.parentNode).not.toBeNull()
wrapper.destroy()
```

@@ -336,15 +336,12 @@ wrapper.destroy()
`attachToDocument` is deprecated and will be removed in future releases. Use [`attachTo`](#attachto) instead. For example, if you need to attach the component to the document.body:

```js
const elem = document.createElement('div')
if (document.body) {
document.body.appendChild(elem)
}
wrapper = mount(Component, {
attachTo: elem
attachTo: document.body
})
```

For more information, see [`attachTo`](#attachto)'s tip above.
:::

Like [`attachTo`](#attachto), but automatically creates a new `div` element for you and inserts it into the body.
2 changes: 1 addition & 1 deletion docs/api/wrapper-array/contains.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### contains
## contains

Assert every wrapper in `WrapperArray` contains selector.

8 changes: 6 additions & 2 deletions docs/api/wrapper/findAllComponents.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Returns a [`WrapperArray`](../wrapper-array/) of all matching Vue components.

- **Arguments:**

- `{Component|ref|name} selector`
- `selector` Use any valid [selector](../selectors.md)

- **Returns:** `{WrapperArray}`

@@ -19,5 +19,9 @@ const wrapper = mount(Foo)
const bar = wrapper.findAllComponents(Bar).at(0)
expect(bar.exists()).toBeTruthy()
const bars = wrapper.findAllComponents(Bar)
expect(bar).toHaveLength(1)
expect(bars).toHaveLength(1)
```

::: warning Usage with CSS selectors
Using `findAllComponents` with CSS selector is subject to same limitations as [findComponent](./findComponent.md)
:::
30 changes: 29 additions & 1 deletion docs/api/wrapper/findComponent.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Returns `Wrapper` of first matching Vue component.

- **Arguments:**

- `{Component|ref|name} selector`
- `{Component|ref|string} selector`

- **Returns:** `{Wrapper}`

@@ -24,3 +24,31 @@ expect(barByName.exists()).toBe(true)
const barRef = wrapper.findComponent({ ref: 'bar' }) // => finds Bar by `ref`
expect(barRef.exists()).toBe(true)
```

::: warning Usage with CSS selectors
Using `findComponent` with a CSS selector might have confusing behavior

Consider this example:

```js
const ChildComponent = {
name: 'Child',
template: '<div class="child"></div>'
}

const RootComponent = {
name: 'Root',
components: { ChildComponent },
template: '<child-component class="root" />'
}

const wrapper = mount(RootComponent)

const rootByCss = wrapper.findComponent('.root') // => finds Root
expect(rootByCss.vm.$options.name).toBe('Root')
const childByCss = wrapper.findComponent('.child')
expect(childByCss.vm.$options.name).toBe('Root') // => still Root
```

The reason for such behavior is that `RootComponent` and `ChildComponent` are sharing the same DOM node and only the first matching component is returned for each unique DOM node
:::
2 changes: 1 addition & 1 deletion docs/api/wrapper/setProps.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
Sets `Wrapper` `vm` props and forces update.

::: warning
`setProps` could be called only for top-level component, mounted by `mount` or `shallowMount`
`setProps` should be called only for top-level component, mounted by `mount` or `shallowMount`
:::

```js
4 changes: 4 additions & 0 deletions docs/api/wrapper/trigger.md
Original file line number Diff line number Diff line change
@@ -38,6 +38,10 @@ test('trigger demo', async () => {
})
```

::: tip
When using `trigger('focus')` with [jsdom v16.4.0](https://github.com/jsdom/jsdom/releases/tag/16.4.0) and above you must use the [attachTo](../options.md#attachto) option when mounting the component. This is because a bug fix in [jsdom v16.4.0](https://github.com/jsdom/jsdom/releases/tag/16.4.0) changed `el.focus()` to do nothing on elements that are disconnected from the DOM.
:::

- **Setting the event target:**

Under the hood, `trigger` creates an `Event` object and dispatches the event on the Wrapper element.
Loading