Possible bug in 'How to Use Passport Strategies' test

Just reporting a possible bug. No response needed.

It may be possible the tests for the How to Use Passport Strategies are not working properly. Just to make sure it wasn’t an error on my code, I did a full copy-and-paste from the solution (and edited the '/views/pug/profile' route). I still didn’t pass the test. I skipped this challenge and I am passing the test on the following challenge. This said, Repl seems to be having a hard time with rendering the home page for this project. I often get a Cannot GET / error, which I have learned to ignore, but it makes it kinda hard to work in Repl.

Your project link(s)

For what it’s worth, here’s my Repl: https://replit.com/@drrompecabezas/boilerplate-advancednode

Challenge: How to Use Passport Strategies

Link to the challenge:

Hello there,

It is going to be impossible to tell what the error is without seeing the code as it was for this lesson. Any chance you have a repo with that commit?

Also, the Cannot GET / often appears on the PIP (picture-in-picture) browser, but if you open the full view, the page usually loads.

Just one thing to point out: This is the boilerplate index.pug

  body
    h1.border.center FCC Advanced Node and Express
    h2.center#pug-success-message
    | Looks like this page is being rendered from Pug into HTML!
    | #{title}
    p#pug-variable=message

This is your index.pug

  body
    h1.border.center FCC Advanced Node and Express
    h2.center#pug-success-message
    | #{title}
    p#pug-variable=message

The tests look for this:

assert.match(
        data,
        /Looks like this page is being rendered from Pug into HTML!/gi,
        'A login attempt at this point should redirect to the homepage since we do not have any registered users'
      );

Hope this helps

That was it! It was that line in index.pug.

I re-created the Repl up to that point, making no changes other than as instructed in the lesson and, indeed, it passed the test. Lesson learned: do not change anything not required in the instructions, lest I fail a test. The time to get creative is with the projects. :slight_smile:

The idea of keeping a snapshot per lesson is intriguing and sounds like long-term best practice even if overkill at the moment. I’m only now starting to get used to working with Git, developing locally, and committing to GitHub. But I have yet to figure out how to keep Repl in sync with GitHub (beyond the initial cloning). Until then, it’s good old copy-and-paste.

Test Repl – will delete at some point.
https://boilerplate-advancednode-1.drrompecabezas.repl.co

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.