Mayank Agarwal has Published 410 Articles

crypto.createDiffieHellman() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:50:54

223 Views

The above method creates a DiffieHellman key exchange object with the help of the supplied prime value and an optional specific generator. The generator argument can hold either a string, number or Buffer value. Default value for generator is 2.Syntaxcrypto.createDiffieHelmmanGroup(prime, [primeEncoding], [generator], [generatorEncoding]ParametersThe above parameters are described as below −prime – ... Read More

assert.strictEqual() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:50:29

216 Views

The assert module provides a bunch of different functionalities that are used for function assertion. assert.strictEqual is used to check the equality between two objects or parameters. It will throw an assertion error if both the objects are not equal.Syntaxassert.strictEqual(actual, expected[, message])ParametersThe above parameters are described as below −actual – This ... Read More

assert.rejects() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:50:08

332 Views

The assert module provides a bunch of different functionalities that are used for function assertion. The assert.rejects function will wait for the passed async function 'asyncfn' promise. If asyncfn is a function, it will immediately call this function and will wait for its returned promise to complete. It will then ... Read More

assert.ok() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:49:47

286 Views

The assert module provides a bunch of different functionalities that are used for function assertion. The assert.ok tests whether the values are true or not. It will throw an assertion error if the value is not true.Syntaxassert.ok(value, [message])ParametersThe above parameters are described as below −value – This parameter takes the value ... Read More

assert.notEqual() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:49:25

103 Views

The assert module provides a bunch of different functionalities that are used for function assertion. The assert.notEqual tests that two objects should not be equal. An assertion error is thrown if both the objects are equal.Syntaxassert.notEqual (actual, expected, [message])ParametersThe above parameters are described as below −actual – This parameter contains the ... Read More

assert.notDeepStrictEqual() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:49:04

60 Views

The assert module provides a bunch of different functionalities that are used for function assertion. The assert.notDeepStrictEqual tests that two objects should not be deep strict equal. An assertion error is thrown if both the objects are strictly equal.Syntaxassert.notDeepStrictEqual(actual, expected, [message])ParametersThe above parameters are described as below −actual – This parameter ... Read More

assert.notDeepEqual() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:36:39

54 Views

The assert module provides a bunch of different functionalities that are used for function assertion. The Assert.notDeepEqual() checks inequality between the actual and expected paramters. Also the parameters should not be deep equal. An error will be thrown if the condition is not fulfilled.Syntaxassert.notDeepEqual(actual, expected[, message])ParametersThe above parameters are described ... Read More

assert.ifError() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:36:16

216 Views

The assert module provides a bunch of different functionalities that are used for function assertion. Assert.ifError() function provides a functionality to throw an error if the value is not null or undefined. An error will be thrown if the value is not two of them.Syntaxassert.ifError(value)ParametersThe above parameters are described as below ... Read More

assert.fail() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:35:48

760 Views

The assert module provides a bunch of different functionalities that are used for function assertion. The Assert.fail() throws an assertion error without checking anything. The error produced is either a default message or message passed in the function.Syntaxassert.fail(message)ParametersThe above parameters are described as below −message – This is an optional parameter. ... Read More

assert.equal() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:27:33

337 Views

The assert module provides a bunch of different functionalities that are used for function assertion. Assert.equal() function is one of them. This function is used to test the equality between the actual and expected parameters. An assertion error will be raised if the condition is not fulfilled.Syntaxassert.equal(actual, expected[, message])ParametersThe above ... Read More

Advertisements