Skip to content

Missing tests #42

Closed
Closed

Description

@jankapunkt

When running the code coverage there are still a few lines uncovered:

-------------------------------------|---------|----------|---------|---------|-------------------
File                                 | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------------------------|---------|----------|---------|---------|-------------------
All files                            |   98.62 |    94.48 |     100 |   98.62 |                   
 lib                                 |     100 |    88.88 |     100 |     100 |                   
  request.js                         |     100 |       90 |     100 |     100 | 15,36             
  response.js                        |     100 |       90 |     100 |     100 | 16                
  server.js                          |     100 |    83.33 |     100 |     100 | 18                
 lib/errors                          |   99.09 |    91.66 |     100 |   99.09 |                   
  access-denied-error.js             |     100 |      100 |     100 |     100 |                   
  insufficient-scope-error.js        |     100 |      100 |     100 |     100 |                   
  invalid-argument-error.js          |     100 |      100 |     100 |     100 |                   
  invalid-client-error.js            |     100 |      100 |     100 |     100 |                   
  invalid-grant-error.js             |     100 |      100 |     100 |     100 |                   
  invalid-request-error.js           |     100 |      100 |     100 |     100 |                   
  invalid-scope-error.js             |     100 |      100 |     100 |     100 |                   
  invalid-token-error.js             |     100 |      100 |     100 |     100 |                   
  oauth-error.js                     |      95 |    91.66 |     100 |      95 | 18                
  server-error.js                    |     100 |      100 |     100 |     100 |                   
  unauthorized-client-error.js       |     100 |      100 |     100 |     100 |                   
  unauthorized-request-error.js      |     100 |      100 |     100 |     100 |                   
  unsupported-grant-type-error.js    |     100 |      100 |     100 |     100 |                   
  unsupported-response-type-error.js |     100 |      100 |     100 |     100 |                   
 lib/grant-types                     |   99.61 |    97.14 |     100 |   99.61 |                   
  abstract-grant-type.js             |   97.56 |       85 |     100 |   97.56 | 101               
  authorization-code-grant-type.js   |     100 |    97.72 |     100 |     100 | 147               
  client-credentials-grant-type.js   |     100 |      100 |     100 |     100 |                   
  password-grant-type.js             |     100 |      100 |     100 |     100 |                   
  refresh-token-grant-type.js        |     100 |      100 |     100 |     100 |                   
 lib/handlers                        |    98.6 |    96.38 |     100 |    98.6 |                   
  authenticate-handler.js            |   98.97 |    98.38 |     100 |   98.97 | 63                
  authorize-handler.js               |   98.59 |    96.55 |     100 |   98.59 | 43,215            
  token-handler.js                   |   98.31 |    94.44 |     100 |   98.31 | 120,124           
 lib/models                          |   82.14 |    73.07 |     100 |   82.14 |                   
  token-model.js                     |   82.14 |    73.07 |     100 |   82.14 | 19,23,27,31,35    
 lib/response-types                  |     100 |      100 |     100 |     100 |                   
  code-response-type.js              |     100 |      100 |     100 |     100 |                   
 lib/token-types                     |     100 |    91.66 |     100 |     100 |                   
  bearer-token-type.js               |     100 |    91.66 |     100 |     100 | 51                
 lib/utils                           |     100 |      100 |     100 |     100 |                   
  token-util.js                      |     100 |      100 |     100 |     100 |                   
 lib/validator                       |     100 |      100 |     100 |     100 |                   
  is.js                              |     100 |      100 |     100 |     100 |                   
-------------------------------------|---------|----------|---------|---------|-------------------

I checked the files and all of them were missing checks for thrown Errors/Exceptions. Since throwing specific errors in specific situations is a crucial part of the standard we should at least check, whether these errors are correct / compliant or not.

Activity

  1. dannyreg commented on Oct 15, 2021

    @dannyreg
    Member

    I can look into this, would be nice to finish these before we release what's on development.

  2. jankapunkt commented on Oct 15, 2021

    @jankapunkt
    MemberAuthor

    I agree. I think the most important thing is to see if these errors are compliant with the standard, I think there were issues in the original repo complaining about errors being different from what the standard describes but I am on the run right now so I can't really check

  3. Uzlopak commented on Dec 20, 2021

    @Uzlopak
    Contributor

    @jorenvandeweyer made already the first step for real integration tests in his #100 PR

    Tbh I think we should implement more of those tests.

  4. jankapunkt commented on Dec 20, 2021

    @jankapunkt
    MemberAuthor

    I agree!

  5. added this to the v4.3 milestone on Aug 25, 2022
  6. modified the milestones: v4.3, v4.4 on Mar 21, 2023
  7. jorenvandeweyer commented on Aug 26, 2023

    @jorenvandeweyer
    Member

    Will be covered in V5 release. see #219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions