Comments (13)
@jeroenheijmans Thx for feedback, glad to help. I think with auth-service we're done and you can close this issue.
from sample-angular-oauth2-oidc-with-auth-guards.
This is my first hacktoberfest and I would like to challenge myself.
Could I be assigned these three PRs?
Are you open to me asking questions if I get stuck while doing research?
Thanks!
from sample-angular-oauth2-oidc-with-auth-guards.
@aortiz24 Yeah sure thing! Don't forget to open the PRs after October starts if you want it to "count" for the DigitalOcean event of course.
You can reach me through various media, but most logical are probably either here in the issue, or you could join the contributing.today Hacktoberfest Discord (link topright of the website) and reach out there. You can already DM me there if you need help, and I'll see if they can add a channel for the repository.
Thanks for giving it a go!
from sample-angular-oauth2-oidc-with-auth-guards.
There's a sample-angular-oauth2-oidc-with-auth-guards
channel in the contributing.today Discord where I'll be if anyone has hacktoberfest-related questions!
from sample-angular-oauth2-oidc-with-auth-guards.
Hey @jeroenheijmans, I'm investigating what is needed to accomplish the first PR:
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).
It appears that I would need to follow the steps listed here: https://jasmine.github.io/setup/nodejs.html
If I'm on the right track, please share with me what you'd like me to test for. Thanks!
from sample-angular-oauth2-oidc-with-auth-guards.
@aortiz24 Using their howto does seem like the most thorough way to go about it. I'd guess it would be the harder but also more in-depth and insightful way to do things.
Personally, I'd go a different, probably easier (but less profound) way. If you generate a blanco project with ng new
(using Angular CLI's latest version) they will scaffold everything that is needed to run unit/component tests in an Angular project. I'd recommend doing that and then comparing:
angular.json
, to see what contents is needed to run tests- any files in the tree with called
*.spec.*
and see for which an equivalent is needed - files generated for testing, from the top of my mind they'll include
test.ts
,karma.conf.js
package.json
'sdevDependencies
(some are needed for testing) andscripts
should probably get"test": "ng test"
or some such
Try to run ng test
whenever you feel it should be working, adding more missing pieces as you go, until it runs.
PS. It would be okay to start with a PR that allows running ng test
locally, and we add GitHub Actions support later.
Feel free to open a PR even if you're halfway through and want some feedback. At work we tend to prefix the PR title with [WIP]:
to indicate it is a "Work In Progress".
Ping me if you need more help!
from sample-angular-oauth2-oidc-with-auth-guards.
I tried, but want to focus on other attainable pull requests. Thank you for giving me a chance!
from sample-angular-oauth2-oidc-with-auth-guards.
@aortiz24 No problem! Good luck with the other PRs, hope they provide you a better path into OSS than this issue did!
from sample-angular-oauth2-oidc-with-auth-guards.
Hi @jeroenheijmans, mb do you want to try jest as test runner for testing instead of karma ? It's a more modern and faster tool than karma. I'm currently using It in my projects and It works like a charm. I would like to help you with jest.
from sample-angular-oauth2-oidc-with-auth-guards.
Hey @valburyakov! I knew about Jest but haven't had the time to try it out yet.
My main concern would be is that this sample (the repository) should be accessible to all kinds of Angular folks. I'd be afraid that folks using the default (Jasmine+Karma) testing setup would possibly be put off by a Jest setup, whereas the reverse would be less true (I expect those who explicitly choose Jest also know how to handle Jasmine tests).
Having said that, I'm not entirely opposed. In fact, it would be an opportunity for me to learn! I'd happily accept a PR that adds Jest-based tests for this repository. I might later decide to migrate that back to Jasmine if I feel it would hurt users with the "default" testing setup, so if you don't mind a chance that I might do that, then please do give it a go!
from sample-angular-oauth2-oidc-with-auth-guards.
I got your point, makes sense. And as I see you have e2e tests which also use jasmine then It will be more consistent use jasmine for unit tests too.
But before implementing unit tests for auth-service need to make it more testable to provide via DI window and location objects in order to have ability to mock them.
from sample-angular-oauth2-oidc-with-auth-guards.
need to make it more testable to provide via DI window and location objects in order to have ability to mock them
Perfect! That'll be a great improvement. I'll have a peek at the PR.
Edit: I've tried the PR locally and it works as it should. Nice work! And again, I applaud changes to make things better testable, that'll make this sample all the more exemplary. 👍
from sample-angular-oauth2-oidc-with-auth-guards.
PR #67 was some more excellent work! <3
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).
from sample-angular-oauth2-oidc-with-auth-guards.
Related Issues (20)
- Difference between this sample repository and the samples in the library's repository HOT 1
- Switch from demo.identityserver.io instance
- Microsoft Azure AD takes longer time on initial load with same setup HOT 6
- Getting silent_refresh_timeout right after "Content Security Policy" violation for "frame-ancestors 'none'" HOT 5
- Kicks me out a second after logging in HOT 5
- isAuthenticated observable is false when localStorage is used HOT 3
- Steps for Azure AD HOT 2
- (Cross-post) Announcement about moderation of the library's community
- Question - Howto redirect to login page directly HOT 1
- Application logs out too quickly in Firefox HOT 1
- I stay authenticated even after i logout HOT 5
- Keep sending id_token as auth bearer HOT 1
- Update to Angular 16 HOT 1
- Replace Protractor with other end-to-end testing utilities HOT 3
- Consider dropping silent-refresh/iframe by using refresh endpoint HOT 3
- The attempt at silent refresh during the runInitialLoginSequence method can cause extremely long page loads if no token is present depending on the server used HOT 2
- Upgrade to Angular 17
- Upgrade Sample to Angular 18
- Hash location strategy for Angular 14.x redirect url lost HOT 1
- modify behavior of default interceptor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample-angular-oauth2-oidc-with-auth-guards.