Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Where a and b are positive or negative integers.

    There are tests with zeros.

  • Custom User Avatar

    Tests could just use assert.fail.

    Now wondering how to do [1..5] ( which is almost (1)[5], but you can't have a Number there ). Also wondering what people don't like. They're voting, but they're not telling you what or how to improve.

  • Custom User Avatar

    I don't think you can nest it blocks, the sample tests throw an error because you're not closing the blocks the right way, I suggest you replace the nested it blocks like this:

    Test.describe("Basic Tests", function(){
      Test.describe("It should works for basic tests.", function(){
    
        Test.it("checking 1.55", function() {
          Test.assertEquals(f(1.55), false);
        });
        Test.it("checking -100", function() {
          Test.assertEquals(f(-100), true);
        });
      });
    });
    
    

    Also, be consistent about what you use for the tests.

  • Custom User Avatar

    You really need to specify isInteger is disabled, and that only Numbers will be tested.

    All current solutions bug out on f(false), which is a valid input according to the description.