Skip to content

[Bug]: Does the mock method really support spy: true  #1141

@cgfeel

Description

@cgfeel

Version

System: OS X
browsers: chrome 146
version: `"@rstest/core": "^0.9.6",`

Details

link this document:

https://rstest.rs/zh/api/runtime-api/rstest/mock-modules#%E4%BD%BF%E7%94%A8--spy-true--%E9%80%89%E9%A1%B9

code that:

rs.mock('../src/validate', { spy: true });

error tips:

对象字面量只能指定已知属性,并且“spy”不在类型“MockFactory”中。

open source code, have‘vt spy defined:

mock<T = unknown>(moduleName: string | Promise<T>, moduleFactory?: MockFactory<T>): void; 

Reproduce link

https://github.com/cgfeel/rstest-stackblitz-example/blob/main/test/index.test.ts#L4

Reproduce Steps

  1. git clone git@github.com:cgfeel/rstest-stackblitz-example.git
  2. pnpm install
  3. open source code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions