12 sendbox - ranhs/soda-test GitHub Wiki

Sinon libraray suggest using sandbox, to ease the need of cleaning up spies and stubs. Soda-Test gives a way to define sandboxes too.
Sandbox variables can be defined only as member variables of the test-class. Define a member vairible of type SinonSandbox and give it a decorator named sandbox with no arguments:

@sandbox()
sandbox: SinonSandbox

You can use the variable defined anyware in the code (see Sinon documenation on sandbox). You may defined more than one sandbox in a class, and use them as needed. Sandbox are alway global (even if defined insdie a context).
Since soda-test is responsible for releasing spies and stubs after each test-step, sandbox are not needed.

⚠️ **GitHub.com Fallback** ⚠️