beforeEach(async () => {
const sandbox = sinon.sandbox.create()
...
})
test('/add', () => {
// how can I use sandbox here?
})
Run Code Online (Sandbox Code Playgroud)
我需要的是类似t.contextava
Bri*_*ams 10
只需声明沙箱,即可在beforeEach和test的范围内使用它:
let sandbox;
beforeEach(async () => {
sandbox = sinon.sandbox.create()
...
})
test('/add', () => {
// sandbox available for use
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4267 次 |
| 最近记录: |