.
const numMinusSeven = function(num) { return num - 7; }
- const numMinusSeven = function(num) {
let youGoodBro = [];while (num > 0) {num -= 7;youGoodBro.push(num);}return youGoodBro.length;- return num - 7;
- }
const chai = require("chai"); const assert = chai.assert; chai.config.truncateThreshold = 0; const Test = require("@codewars/test-compat"); describe("Test", function() { it("should test for 1000", function() { Test.assertEquals(numMinusSeven(1000), 993); }); it("should test for 100", function() { Test.assertEquals(numMinusSeven(100), 93); }); it("should test for 10", function() { Test.assertEquals(numMinusSeven(10), 3); }); });
- const chai = require("chai");
- const assert = chai.assert;
- chai.config.truncateThreshold = 0;
- const Test = require("@codewars/test-compat");
- describe("Test", function() {
- it("should test for 1000", function() {
Test.assertEquals(numMinusSeven(1000), 143);- Test.assertEquals(numMinusSeven(1000), 993);
- });
- it("should test for 100", function() {
Test.assertEquals(numMinusSeven(100), 15);- Test.assertEquals(numMinusSeven(100), 93);
- });
- it("should test for 10", function() {
Test.assertEquals(numMinusSeven(10), 2);- Test.assertEquals(numMinusSeven(10), 3);
- });
- });