* @param {Chai.ChaiStatic} chai * @param {Chai.ChaiUtils} utils
(chai, utils)
| 128 | * @param {Chai.ChaiUtils} utils |
| 129 | */ |
| 130 | function installWrappers(chai, utils) { |
| 131 | const {CHAINABLE_METHOD, METHOD, PROPERTY} = ChaiType; |
| 132 | const {Assertion} = chai; |
| 133 | |
| 134 | for (const {name, type, unsupported} of chaiMethodsAndProperties) { |
| 135 | /** @type {function(Chai.AssertionStatic): void} */ |
| 136 | const overwrite = unsupported |
| 137 | ? overwriteUnsupported |
| 138 | : overwriteAlwaysUseSuper(utils); |
| 139 | |
| 140 | switch (type) { |
| 141 | case METHOD: |
| 142 | Assertion.overwriteMethod(name, overwrite); |
| 143 | break; |
| 144 | case PROPERTY: |
| 145 | // TODO(#28387) cleanup this type. |
| 146 | Assertion.overwriteProperty(name, /** @type {*} */ (overwrite)); |
| 147 | break; |
| 148 | case CHAINABLE_METHOD: |
| 149 | Assertion.overwriteChainableMethod( |
| 150 | name, |
| 151 | overwrite, |
| 152 | /** @type {() => any} */ (inheritChainingBehavior) |
| 153 | ); |
| 154 | break; |
| 155 | default: |
| 156 | throw new Error('Unknown ChaiType'); |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * @param {Chai.ChaiUtils} utils |
nothing calls this directly
no test coverage detected