Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to assert in javascript

//Code prints "Hello, ${username}!" and defaults to Jasmine if no username
//is provided

const hello = require('../hello.js');
const assert = require('assert'); //must require the assert

describe("hello", function(){
it("should return custom message when name is specified", function(){
   assert.strictEqual(hello("Jasmine"), "Hello, Jasmine!");
	});
});

assert.strictEqual(hello("Jasmine"), "Hello, Jasmine!"); 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #assert #javascript
ADD COMMENT
Topic
Name
6+7 =