Files
Randell Dawson 1494a50123 fix(guide): restructure curriculum guide articles (#36501)
* fix: restructure certifications guide articles
* fix: added 3 dashes line before prob expl
* fix: added 3 dashes line before hints
* fix: added 3 dashes line before solutions
2019-07-24 13:29:27 +05:30

819 B

title
title
Learn How JavaScript Assertions Work

Learn How JavaScript Assertions Work


Problem Explanation

To begin, locate the file "tests/1_unit_tests.js".

This file contains multiple suites of tests for the project, and this first challenge requires you to make the tests in /** 1 */ to pass.


Hints

Hint 1

The two lines in the test should be changed from assert.fail() to either assert.isNull() or assert.isNotNull().


Solutions

Solution 1 (Click to Show/Hide)
/** 1 - Use assert.isNull() or assert.isNotNull() to make the tests pass. **/
test('#isNull, #isNotNull', function() {
  assert.isNull(
    null,
    'this is an optional error description - e.g. null is null'
  );
  assert.isNotNull(1, '1 is not null');
});