Skip to content

Commit

Permalink
Merge pull request #1973 from mgred/default-sandbox-example
Browse files Browse the repository at this point in the history
docs(sandbox): add example for default sandbox
  • Loading branch information
mgred authored Feb 4, 2019
2 parents e80f8d9 + 876aebb commit 894951c
Show file tree
Hide file tree
Showing 36 changed files with 540 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/_releases/latest/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.1/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.10/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.2/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.3/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.4/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.5/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.6/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.7/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.8/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.0.9/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v5.1.0/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v6.0.0/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v6.0.1/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v6.1.0/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v6.1.1/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v6.1.2/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
15 changes: 15 additions & 0 deletions docs/_releases/v6.1.3/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ describe('myAPI.hello method', function () {

Since `[email protected]`, the `sinon` object is a default sandbox. Unless you have a very advanced setup or need a special configuration, you probably want to just use that one.

```javascript
const myObject = {
'hello': 'world'
};

sinon.stub(myObject, 'hello').value('Sinon');

console.log(myObject.hello);
// Sinon

sinon.restore();
console.log(myObject.hello);
// world
```

#### `var sandbox = sinon.createSandbox();`

Creates a new sandbox object with spies, stubs, and mocks.
Expand Down
Loading

0 comments on commit 894951c

Please sign in to comment.