Skip to content

Documentation: API Chai Examples Incorrect #437

Closed
@dennythecoder

Description

@dennythecoder

Version

1.0.0-beta.12

Reproduction link

https://vue-test-utils.vuejs.org/en/api/mount.html

Steps to reproduce

Example shows

import { shallow } from '@vue/test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

describe('Foo', () => {
  it('renders a div', () => {
    const wrapper = shallow(Foo)
    expect(wrapper.contains('div')).toBe(true)
  })
})

What is expected?

Based upon Chai API, example would have:

expect(wrapper.contains('div')).to.be.true

What is actually happening?

Example shows

expect(wrapper.contains('div')).toBe(true)

This style seems consistent with Jest.


This is in a few areas of the API. Should the documentation show the Chai syntax for expect or the Jest syntax?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions