Skip to content

Missing tests #42

Closed
Closed
@jankapunkt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions