|
1 | 1 | ---
|
2 | 2 | title: Building a Helper
|
| 3 | + layout: guide |
| 4 | + bodyClass: guide |
| 5 | + weight: 0 |
3 | 6 | order: 40
|
4 | 7 | headings:
|
5 | 8 | - Adding Language Chains
|
@@ -110,7 +113,7 @@ utils.addProperty(Assertion.prototype, 'model', function () {
|
110 | 113 | });
|
111 | 114 | ```
|
112 | 115 |
|
113 |
| -<a href="/api/plugins/#addProperty-section" class="clean-button">View addProperty API</a> |
| 116 | +<a href="{{site.github.url}}/api/plugins/#method_addproperty" class="clean-button">View addProperty API</a> |
114 | 117 |
|
115 | 118 | Simple and concise. Chai can take it from here. It is also worth mentioning that
|
116 | 119 | because this extension pattern is used so often, Chai makes it just a bit easier.
|
@@ -154,7 +157,7 @@ Assertion.addMethod('model', function (type) {
|
154 | 157 | });
|
155 | 158 | ```
|
156 | 159 |
|
157 |
| -<a href="/api/plugins/#addMethod-section" class="clean-button">View addMethod API</a> |
| 160 | +<a href="{{site.github.url}}/api/plugins/#method_addmethod" class="clean-button">View addMethod API</a> |
158 | 161 |
|
159 | 162 | All calls to `assert` are synchronous, so if the first one fails the `AssertionError`
|
160 | 163 | is thrown and the second one will not be reached. It is up to the test runner to interpret
|
@@ -268,7 +271,7 @@ finish up here first...
|
268 | 271 | Assertion.addChainableMethod('age', assertModelAge, chainModelAge);
|
269 | 272 | ```
|
270 | 273 |
|
271 |
| -<a href="/api/plugins/#addChainableMethod-section" class="clean-button">View addChainableMethod API</a> |
| 274 | +<a href="{{site.github.url}}/api/plugins/#method_addchainablemethod" class="clean-button">View addChainableMethod API</a> |
272 | 275 |
|
273 | 276 | Done. Now we can assert Arthur's exact age. We will pick up again with this example when learning how to overwrite methods.
|
274 | 277 |
|
@@ -308,7 +311,7 @@ chai.overwriteProperty('ok', function (_super) {
|
308 | 311 | });
|
309 | 312 | ```
|
310 | 313 |
|
311 |
| -<a href="/api/plugins/#overwriteProperty-section" class="clean-button">View overwriteProperty API</a> |
| 314 | +<a href="{{site.github.url}}/api/plugins/#method_overwriteproperty" class="clean-button">View overwriteProperty API</a> |
312 | 315 |
|
313 | 316 | ##### Overwrite Structure
|
314 | 317 |
|
@@ -426,7 +429,7 @@ Assertion.overwriteMethod('above', function (_super) {
|
426 | 429 | });
|
427 | 430 | ```
|
428 | 431 |
|
429 |
| -<a href="/api/plugins/#overwriteMethod-section" class="clean-button">View overwriteMethod API</a> |
| 432 | +<a href="{{site.github.url}}/api/plugins/#method_overwritemethod" class="clean-button">View overwriteMethod API</a> |
430 | 433 |
|
431 | 434 | This covers both positive and negative scenarios. No need to transfer flags in this
|
432 | 435 | case as `this.assert` handles that automatically. The same pattern can also be used
|
|
0 commit comments