Ad
  • Custom User Avatar
    assert.strictEqual(helper.pageIndex(0), 0, "pageIndex(0)")
                                        ^   ^
                                        |   This is the index of the page that the item would be on
                                        |
                                        This is the index of the item in the collection
    

    helper.pageIndex(0) Will find the index of the page which includes the item at index 0 of the collection (In this case, 1). The return value being 0 means that 1 is included on the page with index 0 (the first page).

  • Custom User Avatar

    On the Typescript test the collection has no "0" item.

    const collection = [
        1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
        22, 23, 24,
      ]
    

    this test:

      assert.strictEqual(helper.pageIndex(0), 0, "pageIndex(0)")
    

    there are no 0 item on the given collection.

    so I thought it should return as "-1" ?

  • Custom User Avatar

    I also have the same error in don't know why

  • Custom User Avatar

    Punctuations mark are not limited to what you've considered so far...

  • Custom User Avatar

    I am using TS

    TSError: ⨯ Unable to compile TypeScript:
    test.ts:2:23 - error TS2306: File '/workspace/default/solution.ts' is not a module.

    2 import { greet } from "./solution";
    ~~~~~~~~~~~~

  • Custom User Avatar

    Solved. Closing.

  • Custom User Avatar

    Fork and fix waiting for approval.

  • Custom User Avatar

    I'm not familiar with chai so not claiming this is the best fix, but replacing the basic tests with this gets it working

        assert(rgb(0, 0, 0) === "000000", 'expected 0,0,0 to equal 000000');
        assert(rgb(0, 0, -20) === "000000", 'expected 0,0,-20 to equal 000000');
        assert(rgb(300, 255, 255) === "FFFFFF", 'expected 300,255,255 to equal FFFFFF');
        assert(rgb(173, 255, 47) === "ADFF2F", 'expected 173,255,47 to equal ADFF2F');
    
  • Custom User Avatar

    Error test failed:
    expected 'ihGVsgaZUsgSPay pKISbPhpcOTmAXIdpdIay…' to equal 'ihGVsgaZUsgSPay pKISbPhpcOTmAXIdpdIay…'

    I check the strings:
    console.log("ihGVsgaZUsgSPay pKISbPhpcOTmAXIdpdIay…" == "ihGVsgaZUsgSPay pKISbPhpcOTmAXIdpdIay…") // true;

    How can I make the "Random test failed error" to show the complete words?

  • Custom User Avatar
  • Custom User Avatar

    WHen I try to Test on Typescript I get an error:

    TSError: ⨯ Unable to compile TypeScript:
    test.ts:7:5 - error TS2552: Cannot find name 'Test'. Did you mean 'test'?

    7 Test.assertEquals(rgb(0, 0, 0), "000000")