beforeEach(async () => { const sandbox = sinon.sandbox.create() ... }) test('/add', () => { // how can I use sandbox here? })
What I need is something like t.context
in ava
Just declare sandbox so it is available in the scope of beforeEach and test:
let sandbox; beforeEach(async () => { sandbox = sinon.sandbox.create() ... }) test('/add', () => { // sandbox available for use })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With