Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Adam Fisher
Added: Jun 23, 2018 8:58 PM
Views: 15
Tags: assert
Basic Assert Function for testing
  1. 1function assertEqual(actual, expected, testName) {
  2. 2│   if (actual === expected) {
  3. 3│     console.log('passed');
  4. 4│   } else {
  5. 5│     console.log('FAILED ' + testName + ': Expected ' + expected + ', but got ' + actual);
  6. 6│   }
  7. 7}