gpt4 book ai didi

javascript - printf 每个都有一个对象节点 #8774

转载 作者:行者123 更新时间:2023-12-01 00:46:22 24 4
gpt4 key购买 nike

// Returns Testing [Object object]
describe.skip.each([[{foo: 'abc'}], [{foo: 'bca'}]])('Testing %s', ...
// Returns Testing {foo: 'abc'}
describe.skip.each([[{foo: 'abc'}], [{foo: 'bca'}]])('Testing %o', ...

是否可以做类似的事情

// Expect Testing abc
describe.skip.each([[{foo: 'abc'}], [{foo: 'bca'}]])('Testing %o.foo', ...

最佳答案

我认为使用该 API 是不可能的,但使用 second API it is 是不可能的

describe.each`
column
${{ foo: 'abc' }}
${{ foo: 'bca' }}
`
('Testing $column.foo', ({ column }) => {
...
})

更新

Sadly you cannot build a template literal programmatically , here's how tagged template literals work需要 ${expresion} 来标识您要传递的数据。

关于javascript - printf 每个都有一个对象节点 #8774,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57319078/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com