function add(a, b){ return a - (-b); }
// write a add function that doesn't use the plus symbol- function add(a, b){
return a + b;}// Make sure to view the test cases to see how this test fails- return a - (-b);
- }
const fs = require('fs'); const solution = fs.readFileSync('/home/codewarrior/solution.txt', 'utf8'); describe("Check Solution", function(){ it("should prevent the '+' symbol from being used anywhere in the code", function(){ Test.expect(solution.indexOf('+') == -1, "Your code isn't allowed to include the + symbol!"); Test.assertEquals(add(2,4), 6); Test.assertEquals(add(4,5), 9); Test.assertEquals(add(-2,4), 2); }); });
- const fs = require('fs');
- const solution = fs.readFileSync('/home/codewarrior/solution.txt', 'utf8');
- describe("Check Solution", function(){
- it("should prevent the '+' symbol from being used anywhere in the code", function(){
- Test.expect(solution.indexOf('+') == -1, "Your code isn't allowed to include the + symbol!");
- Test.assertEquals(add(2,4), 6);
- Test.assertEquals(add(4,5), 9);
- Test.assertEquals(add(-2,4), 2);
- });
- });