Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid assert.throws statements #419

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

igonro
Copy link
Contributor

@igonro igonro commented Mar 8, 2022

Closes #416.

  • Fix invalid assert.throws statements
  • Run the tests again and check that the tests passed

To review: @risenW @steveoni

@igonro
Copy link
Contributor Author

igonro commented Mar 8, 2022

After fixing the invalid assert.throws, some of the node tests are not passing. This is the output:

  707 passing (965ms)
  2 failing

  1) DataFrame
       addColumn
         throw error for wrong column length:

      AssertionError: expected [Function] to throw error including 'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 4' but got 'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 3'
      + expected - actual

      -ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 3
      +ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 4

      at Context.<anonymous> (test/core/frame.test.ts:131:20)
      at processImmediate (internal/timers.js:464:21)

  2) Generic (NDFrame)
       NDframe Created from Array
         Throws error on duplicate index:

      AssertionError: expected [Function] to throw error including 'IndexError: Row index must contain unique values' but got 'IndexError: You provided an index of length 3 but Ndframe rows has length of 2'
      + expected - actual

      -IndexError: You provided an index of length 3 but Ndframe rows has length of 2
      +IndexError: Row index must contain unique values

      at Context.<anonymous> (test/core/generic.test.ts:72:20)
      at processImmediate (internal/timers.js:464:21)

@igonro
Copy link
Contributor Author

igonro commented Mar 8, 2022

The same happens for some browser tests:

Chrome Headless 98.0.4758.102 (Linux x86_64) DataFrame addColumn throw error for wrong column length FAILED
        AssertionError: expected [Function] to throw error including 'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 4' but got 'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 3'
            at Context.<anonymous> (/tmp/7ad0f53a5cff4b52986a8d5fc061a919.browserify.js:151280:14)

Chrome Headless 98.0.4758.102 (Linux x86_64) Generic (NDFrame) NDframe Created from Array Throws error on duplicate index FAILED
        AssertionError: expected [Function] to throw error including 'IndexError: Row index must contain unique values' but got 'IndexError: You provided an index of length 3 but Ndframe rows has length of 2'
            at Context.<anonymous> (/tmp/7ad0f53a5cff4b52986a8d5fc061a919.browserify.js:154123:14)

@igonro
Copy link
Contributor Author

igonro commented Mar 8, 2022

I solved those errors. Now all the tests are passing! 🎉

I'm glad I casually found those assert.throws typos while working in #417, because they were hiding a little bug in the shared/errors.ts file, and other little bug in the tests of "Throws error on duplicate index" 😄

@igonro igonro marked this pull request as ready for review March 8, 2022 12:31
@risenW risenW requested review from risenW and steveoni March 9, 2022 07:39
@igonro
Copy link
Contributor Author

igonro commented Mar 9, 2022

Done! @steveoni
I did it for the js files. Maybe is needed for the ts files too(?)
I looked at some assert.throws, but the lint style is a bit different sometimes.

@igonro igonro requested a review from steveoni March 11, 2022 13:27
@steveoni steveoni merged commit b77662d into javascriptdata:dev Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix some invalid assert.throws statements
2 participants