You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-4Lines changed: 39 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -268,11 +268,11 @@ Allows for the insertion of OpenSCAD code, prior to the assertion being tested.
268
268
### `assert.openScadFunction(openScadFunction)`
269
269
270
270
**Returns:**
271
-
272
271
```javascript
273
272
{
274
273
'not':function() {...},
275
-
'outputToBe':function(expectedOutput) {...}
274
+
'outputToBe':function(expectedOutput) {...},
275
+
'typeToBe':function(expectedType) {...}
276
276
}
277
277
```
278
278
@@ -288,7 +288,8 @@ Begins an assertion or multiple assertions on an OpenSCAD function.
288
288
```javascript
289
289
{
290
290
'not':function() {...},
291
-
'outputToBe':function(expectedOutput) {...}
291
+
'outputToBe':function(expectedOutput) {...},
292
+
'typeToBe':function(expectedType) {...}
292
293
}
293
294
```
294
295
@@ -301,7 +302,8 @@ Negates the expectation of the following assertion. This is used in a chain of c
301
302
{
302
303
'and': {
303
304
'not':function() {...},
304
-
'outputToBe':function(expectedOutput) {...}
305
+
'outputToBe':function(expectedOutput) {...},
306
+
'typeToBe':function(expectedType) {...}
305
307
}
306
308
}
307
309
```
@@ -312,6 +314,39 @@ Performs an equality check on the returned value of an OpenSCAD function.
312
314
|---|---|---|
313
315
| expectedOutput | String | The expected output of the previously specified OpenSCAD function as a string. |
314
316
317
+
318
+
### `typeToBe(expectedType)`
319
+
320
+
**Returns:** {
321
+
```javascript
322
+
{
323
+
'and': {
324
+
'not':function() {...},
325
+
'outputToBe':function(expectedOutput) {...},
326
+
'typeToBe':function(expectedType) {...}
327
+
}
328
+
}
329
+
```
330
+
331
+
Performs an equality check on the type of the returned value of an OpenSCAD function. Use by asserting against the global object `OpenScadType` as seen below.
332
+
333
+
| Parameter | Data Type | Description |
334
+
|---|---|---|
335
+
| expectedType | String | The expected type of the output of the previously specified OpenSCAD function as a string. Use with `OpenScadType` to ensure correctness. |
0 commit comments