Skip to content

[📖 Docs]: <title> Fix mock.restore docs #13018

@olegKusov

Description

@olegKusov

Pre-check

  • I know I can edit the docs but prefer to file this issue

Describe the improvement

Unclear documentation

Description of the improvement / report

https://webdriver.io/docs/api/mock/restore/

it('should demonstrate the addValue command', async () => {
    const mock = await browser.mock('**\/googlelogo_color_272x92dp.png')
    mock.respond('https://webdriver.io/img/webdriverio.png')
    await browser.url('https://google.com') // shows WebdriverIO logo instead of Google

    mock.restore()
    await browser.url('https://google.com') // shows normal Google logo again
})

In docs you do not use await in mock.restore(). it will result to error "Reason: TypeError: Cannot read properties of undefined (reading 'delete')". Please fix docs by adding await to mock.restore

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions