Skip to content

Commit a12514b

Browse files
committed
Updating docs
1 parent ca7ffac commit a12514b

2 files changed

Lines changed: 185 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ember-sinon-sandbox-codemod <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
1919
## Transforms
2020

2121
<!--TRANSFORMS_START-->
22+
* [ember-sinon-sandbox-codemod](transforms/ember-sinon-sandbox-codemod/README.md)
2223
<!--TRANSFORMS_END-->
2324

2425
## Contributing

transforms/ember-sinon-sandbox-codemod/README.md

Lines changed: 184 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,190 @@ ember-sinon-sandbox-codemod ember-sinon-sandbox-codemod path/of/files/ or/some**
1515
## Input / Output
1616

1717
<!--FIXTURES_TOC_START-->
18+
* [sinon.sandbox.create.empty.beforeeach](#sinon.sandbox.create.empty.beforeeach)
19+
* [sinon.sandbox.create.funcref.beforeeach](#sinon.sandbox.create.funcref.beforeeach)
20+
* [sinon.sandbox.create.nonempty.beforeeach](#sinon.sandbox.create.nonempty.beforeeach)
21+
* [sinon.sandbox.restore.empty.aftereach](#sinon.sandbox.restore.empty.aftereach)
22+
* [sinon.sandbox.restore.nonempty.aftereach](#sinon.sandbox.restore.nonempty.aftereach)
1823
<!--FIXTURES_TOC_END-->
1924

2025
<!--FIXTURES_CONTENT_START-->
21-
<!--FIXTURES_CONTENT_END-->
26+
---
27+
<a id="sinon.sandbox.create.empty.beforeeach">**sinon.sandbox.create.empty.beforeeach**</a>
28+
29+
**Input** (<small>[sinon.sandbox.create.empty.beforeeach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.create.empty.beforeeach.input.js)</small>):
30+
```js
31+
import { moduleForAcceptance, test } from 'ember-qunit';
32+
33+
moduleForAcceptance('foo', 'Acceptance | Foo', {
34+
beforeEach() {
35+
// setup the sandbox
36+
this.sandbox = sinon.sandbox.create();
37+
},
38+
39+
afterEach() {},
40+
});
41+
42+
test('it happens', function(assert) {
43+
assert.ok(true);
44+
});
45+
46+
```
47+
48+
**Output** (<small>[sinon.sandbox.create.empty.beforeeach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.create.empty.beforeeach.output.js)</small>):
49+
```js
50+
import { moduleForAcceptance, test } from 'ember-qunit';
51+
52+
moduleForAcceptance('foo', 'Acceptance | Foo', {});
53+
54+
test('it happens', function(assert) {
55+
assert.ok(true);
56+
});
57+
58+
```
59+
---
60+
<a id="sinon.sandbox.create.funcref.beforeeach">**sinon.sandbox.create.funcref.beforeeach**</a>
61+
62+
**Input** (<small>[sinon.sandbox.create.funcref.beforeeach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.create.funcref.beforeeach.input.js)</small>):
63+
```js
64+
import { moduleForAcceptance, test } from 'ember-qunit';
65+
import { before } from './before';
66+
67+
moduleForAcceptance('foo', 'Acceptance | Foo', {
68+
beforeEach: before,
69+
});
70+
71+
test('it happens', function(assert) {
72+
assert.ok(true);
73+
});
74+
75+
```
76+
77+
**Output** (<small>[sinon.sandbox.create.funcref.beforeeach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.create.funcref.beforeeach.output.js)</small>):
78+
```js
79+
import { moduleForAcceptance, test } from 'ember-qunit';
80+
import { before } from './before';
81+
82+
moduleForAcceptance('foo', 'Acceptance | Foo', {
83+
beforeEach: before,
84+
});
85+
86+
test('it happens', function(assert) {
87+
assert.ok(true);
88+
});
89+
90+
```
91+
---
92+
<a id="sinon.sandbox.create.nonempty.beforeeach">**sinon.sandbox.create.nonempty.beforeeach**</a>
93+
94+
**Input** (<small>[sinon.sandbox.create.nonempty.beforeeach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.create.nonempty.beforeeach.input.js)</small>):
95+
```js
96+
import { moduleForAcceptance, test } from 'ember-qunit';
97+
98+
moduleForAcceptance('foo', 'Acceptance | Foo', {
99+
beforeEach() {
100+
otherSetup();
101+
// setup the sandbox
102+
this.sandbox = sinon.sandbox.create();
103+
},
104+
105+
afterEach() {},
106+
});
107+
108+
test('it happens', function(assert) {
109+
assert.ok(true);
110+
});
111+
112+
```
113+
114+
**Output** (<small>[sinon.sandbox.create.nonempty.beforeeach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.create.nonempty.beforeeach.output.js)</small>):
115+
```js
116+
import { moduleForAcceptance, test } from 'ember-qunit';
117+
118+
moduleForAcceptance('foo', 'Acceptance | Foo', {
119+
beforeEach() {
120+
otherSetup();
121+
},
122+
});
123+
124+
test('it happens', function(assert) {
125+
assert.ok(true);
126+
});
127+
128+
```
129+
---
130+
<a id="sinon.sandbox.restore.empty.aftereach">**sinon.sandbox.restore.empty.aftereach**</a>
131+
132+
**Input** (<small>[sinon.sandbox.restore.empty.aftereach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.restore.empty.aftereach.input.js)</small>):
133+
```js
134+
import { moduleForAcceptance, test } from 'ember-qunit';
135+
136+
moduleForAcceptance('foo', 'Acceptance | Foo', {
137+
beforeEach() {
138+
// setup the sandbox
139+
this.sandbox = sinon.sandbox.create();
140+
},
141+
142+
afterEach() {
143+
this.sandbox.restore();
144+
},
145+
});
146+
147+
test('it happens', function(assert) {
148+
assert.ok(true);
149+
});
150+
151+
```
152+
153+
**Output** (<small>[sinon.sandbox.restore.empty.aftereach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.restore.empty.aftereach.output.js)</small>):
154+
```js
155+
import { moduleForAcceptance, test } from 'ember-qunit';
156+
157+
moduleForAcceptance('foo', 'Acceptance | Foo', {});
158+
159+
test('it happens', function(assert) {
160+
assert.ok(true);
161+
});
162+
163+
```
164+
---
165+
<a id="sinon.sandbox.restore.nonempty.aftereach">**sinon.sandbox.restore.nonempty.aftereach**</a>
166+
167+
**Input** (<small>[sinon.sandbox.restore.nonempty.aftereach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.restore.nonempty.aftereach.input.js)</small>):
168+
```js
169+
import { moduleForAcceptance, test } from 'ember-qunit';
170+
171+
moduleForAcceptance('foo', 'Acceptance | Foo', {
172+
beforeEach() {
173+
// setup the sandbox
174+
this.sandbox = sinon.sandbox.create();
175+
},
176+
177+
afterEach() {
178+
otherTeardown();
179+
this.sandbox.restore();
180+
},
181+
});
182+
183+
test('it happens', function(assert) {
184+
assert.ok(true);
185+
});
186+
187+
```
188+
189+
**Output** (<small>[sinon.sandbox.restore.nonempty.aftereach.input.js](transforms/ember-sinon-sandbox-codemod/__testfixtures__/sinon.sandbox.restore.nonempty.aftereach.output.js)</small>):
190+
```js
191+
import { moduleForAcceptance, test } from 'ember-qunit';
192+
193+
moduleForAcceptance('foo', 'Acceptance | Foo', {
194+
afterEach() {
195+
otherTeardown();
196+
},
197+
});
198+
199+
test('it happens', function(assert) {
200+
assert.ok(true);
201+
});
202+
203+
```
204+
<!--FIXTURE_CONTENT_END-->

0 commit comments

Comments
 (0)