question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add specs for auth.service

See original GitHub issue

At the start there were no tests involved in this sample. But since many people found the repository useful, and probably use mainly auth.service.ts as a starting point for their application, it seems useful to add a spec for the core thing they can copy/paste along.

I’m tagging this issue hacktoberfest/up-for-grabs, mainly because creating a start for all of this is something that can be picked up when you start out.

I prefer to have multiple PRs to do this in steps:

  1. First PR to re-enable jasmine and test running for this repository, with just 1 it spec for auth.service.ts, that runs as part of the GitHub Actions pipelines (can be a dummy test)
  2. Second PR to properly add a good mock for the OAuthService and then test the runInitialLoginSequence logic branches
  3. Optionally a third PR to add some Jasmine Marbles based testing, to see what happens in various sequences

Let us know in the issue if you want to pick up any of these and at which timing, to prevent getting conflicts if multiple PRs come in.

(If no one feels like it that’s also fine! Then I might add it myself, later. For now I commit to actively watching for incoming PRs.)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
valburyakovcommented, Oct 13, 2020

@jeroenheijmans Thx for feedback, glad to help. I think with auth-service we’re done and you can close this issue.

0reactions
jeroenheijmanscommented, Oct 11, 2020

PR #67 was some more excellent work! ❤️

The most important thing we now have: a test setup so that

  • A. People using this sample as a starter would have proper tests in their codebase.
  • B. A setup that allows us to TDD additions and changes to this sample

Adding more tests now (more coverage in general, or Jasmine marbles tests, for fun) is in my opinion welcome-but-optional.

I’ll leave the issue open for a moment. @valburyakov if you want to continue the hacktoberfest PR streak and add a follow-up, you’d be most welcome. If you feel it’s all good for now, that’s totally fine too (and then I’d probably close this issue, maybe create a fresh follow-up issue).

Read more comments on GitHub >

github_iconTop Results From Across the Web

RSpec controller specs fail after adding authorization to Rails4 ...
After adding authorization, all of my controller specs fail. My feature specs still pass because in the spec I login as admin to...
Read more >
Authentication - Swagger
After you have defined the security schemes in the securitySchemes section, you can apply them to the whole API or individual operations by...
Read more >
Authentication service | Edge Stack
An AuthService configures Ambassador Edge Stack to use an external service to check authentication and authorization for incoming requests. Each incoming ...
Read more >
Authorization Services Guide - Keycloak
Enabling authorization services​​ You can enable authorization services in an existing client application configured to use the OpenID Connect ...
Read more >
How to Add Authorization to a Rails API Following TDD - Auth0
This piece is about adding authorization to a Ruby on Rails API by ... So, create a lib folder under the spec folder...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found