Reactjs .TohaveStyles规则错误-类型';拉平插值<;ThemeProps<;任何>&燃气轮机';不可分配给类型';字符串';

Reactjs .TohaveStyles规则错误-类型';拉平插值<;ThemeProps<;任何>&燃气轮机';不可分配给类型';字符串';,reactjs,typescript,unit-testing,jestjs,styled-components,Reactjs,Typescript,Unit Testing,Jestjs,Styled Components,我正在使用.toHaveStyleRule进行测试。它在文件中指出: 如果一个规则嵌套在另一个样式化组件中,则修改器选项可与css帮助器一起使用,以定位嵌套规则。 我的测试工作正常,但我得到一个ts错误。这是我的测验 错误打印: (property) jest.Options.modifier?: string Type 'FlattenInterpolation<ThemeProps<any>>' is not assignable to type 'string'.

我正在使用
.toHaveStyleRule
进行测试。它在文件中指出:

如果一个规则嵌套在另一个样式化组件中,则修改器选项可与css帮助器一起使用,以定位嵌套规则。

我的测试工作正常,但我得到一个ts错误。这是我的测验

错误打印:

(property) jest.Options.modifier?: string

Type 'FlattenInterpolation<ThemeProps<any>>' is not assignable to type 'string'.ts(2322)

index.d.ts(14, 7): The expected type comes from property 'modifier' which is declared here on type 'Options'
(属性)jest.Options.modifier?:字符串
类型“FlatterInterpolation”不可分配给类型“string”。ts(2322)
index.d.ts(14,7):预期的类型来自属性'modifier',该属性在这里的类型'Options'上声明
我做错了什么