@@ -4,25 +4,28 @@ import scala.scalajs.js
4
4
import scala .scalajs .js .annotation .JSImport
5
5
6
6
/** The assert module provides a simple set of assertion tests that can be used to test invariants. The module is
7
- * intended for internal use by Node.js, but can be used in application code via require('assert'). However, assert
8
- * is not a testing framework, and is not intended to be used as a general purpose assertion library.
7
+ * intended for internal use by Node.js, but can be used in application code via require('assert'). However, assert is
8
+ * not a testing framework, and is not intended to be used as a general purpose assertion library.
9
9
*
10
- * The API for the assert module is Locked. This means that there will be no additions or changes to any of the
11
- * methods implemented and exposed by the module.
10
+ * The API for the assert module is Locked. This means that there will be no additions or changes to any of the methods
11
+ * implemented and exposed by the module.
12
12
*/
13
13
@ js.native
14
14
trait Assert extends js.Object {
15
15
16
16
/** An alias of assert.ok() .
17
- * @param expression the expression to evaluate
18
- * @example assert(value[, message])
17
+ * @param expression
18
+ * the expression to evaluate
19
+ * @example
20
+ * assert(value[, message])
19
21
*/
20
22
def apply (expression : js.Any , message : String ): Unit = js.native
21
23
def apply (expression : js.Any ): Unit = js.native
22
24
23
25
/** Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the
24
26
* strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes.
25
- * @example assert.deepStrictEqual(actual, expected[, message])
27
+ * @example
28
+ * assert.deepStrictEqual(actual, expected[, message])
26
29
*/
27
30
def deepStrictEqual (actual : js.Any , expected : js.Any , message : String ): Unit = js.native
28
31
def deepStrictEqual (actual : js.Any , expected : js.Any ): Unit = js.native
@@ -40,11 +43,12 @@ trait Assert extends js.Object {
40
43
def doesNotReject (asyncFn : js.Promise [_], message : String ): Unit = js.native
41
44
def doesNotReject (asyncFn : js.Promise [_]): Unit = js.native
42
45
43
- /** Asserts that the function block does not throw an error. See assert.throws() for more details.
44
- * When assert.doesNotThrow() is called, it will immediately call the block function. If an error is thrown
45
- * and it is the same type as that specified by the error parameter, then an AssertionError is thrown. If the
46
- * error is of a different type, or if the error parameter is undefined, the error is propagated back to the caller.
47
- * @example assert.doesNotThrow(block[, error][, message])
46
+ /** Asserts that the function block does not throw an error. See assert.throws() for more details. When
47
+ * assert.doesNotThrow() is called, it will immediately call the block function. If an error is thrown and it is the
48
+ * same type as that specified by the error parameter, then an AssertionError is thrown. If the error is of a
49
+ * different type, or if the error parameter is undefined, the error is propagated back to the caller.
50
+ * @example
51
+ * assert.doesNotThrow(block[, error][, message])
48
52
*/
49
53
def doesNotThrow (block : js.Function , error : js.RegExp , message : String ): Unit = js.native
50
54
def doesNotThrow (block : js.Function , error : js.RegExp ): Unit = js.native
@@ -53,50 +57,57 @@ trait Assert extends js.Object {
53
57
def doesNotThrow (block : js.Function , message : String ): Unit = js.native
54
58
def doesNotThrow (block : js.Function ): Unit = js.native
55
59
56
- /** @see https://nodejs.org/api/assert.html#assert_assert_fail_message
60
+ /** @see
61
+ * https://nodejs.org/api/assert.html#assert_assert_fail_message
57
62
*/
58
63
def fail (message : String ): Unit = js.native
59
64
60
- /** @see https://nodejs.org/api/assert.html#assert_assert_fail_message
65
+ /** @see
66
+ * https://nodejs.org/api/assert.html#assert_assert_fail_message
61
67
*/
62
68
def fail (message : js.Error ): Unit = js.native
63
69
64
70
@ deprecated(" Use assert.fail([message]) or other assert functions instead." , " Node.js v10.0.0" )
65
71
def fail (actual : js.Any , expected : js.Any , message : String , operator : String ): Unit = js.native
66
72
67
73
/** Throws value if value is truthy. This is useful when testing the error argument in callbacks.
68
- * @example assert.ifError(value)
74
+ * @example
75
+ * assert.ifError(value)
69
76
*/
70
77
def ifError (value : js.Any ): Unit = js.native
71
78
72
79
/** Tests for deep strict inequality. Opposite of assert.deepStrictEqual().
73
- * @example assert.notDeepStrictEqual(actual, expected[, message])
80
+ * @example
81
+ * assert.notDeepStrictEqual(actual, expected[, message])
74
82
*/
75
83
def notDeepStrictEqual (actual : js.Any , expected : js.Any , message : String ): Unit = js.native
76
84
def notDeepStrictEqual (actual : js.Any , expected : js.Any ): Unit = js.native
77
85
78
86
/** Tests strict inequality as determined by the strict not equal operator ( !== ).
79
- * @example assert.notStrictEqual(actual, expected[, message])
87
+ * @example
88
+ * assert.notStrictEqual(actual, expected[, message])
80
89
*/
81
90
def notStrictEqual (actual : js.Any , expected : js.Any , message : String ): Unit = js.native
82
91
def notStrictEqual (actual : js.Any , expected : js.Any ): Unit = js.native
83
92
84
- /** Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy,
85
- * an AssertionError is thrown with a message property set equal to the value of the message parameter. If the
86
- * message parameter is undefined, a default error message is assigned.
93
+ /** Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy, an
94
+ * AssertionError is thrown with a message property set equal to the value of the message parameter. If the message
95
+ * parameter is undefined, a default error message is assigned.
87
96
*/
88
97
def ok (value : js.Any , message : String ): Unit = js.native
89
98
def ok (value : js.Any ): Unit = js.native
90
99
91
100
/** Tests strict equality as determined by the strict equality operator ( === ).
92
- * @example assert.strictEqual(actual, expected[, message])
101
+ * @example
102
+ * assert.strictEqual(actual, expected[, message])
93
103
*/
94
104
def strictEqual (actual : js.Any , expected : js.Any , message : String ): Unit = js.native
95
105
def strictEqual (actual : js.Any , expected : js.Any ): Unit = js.native
96
106
97
107
/** If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value
98
108
* of the message parameter. If the message parameter is undefined, a default error message is assigned.
99
- * @example assert.throws(block[, error][, message])
109
+ * @example
110
+ * assert.throws(block[, error][, message])
100
111
*/
101
112
def throws (block : js.Function , error : js.Object , message : String ): Unit = js.native
102
113
def throws (block : js.Function , error : js.Object ): Unit = js.native
0 commit comments