Issue tracker : functional tests : one last EM

Hi,

I’ve got this error message :

Error: expected { status: 'unavailable' } to be an array
    <anonymous> frame-runner.c192af4990ab9ff3bf6b.js line 2 > eval:15
    _callee$ frame-runner.js:93
    u runtime.js:63
    _invoke runtime.js:293
    E runtime.js:118
    Babel 6
    runTests frame-runner.js:69
    t frame.js:55
    l runtime.js:63
    _invoke runtime.js:291
    S runtime.js:118
    Babel 4
    Oe frame.js:52
    t build.js:137
    Redux 15
frame-runner.js:98:16
    _callee$ frame-runner.js:98
    u runtime.js:63
    _invoke runtime.js:293
    E runtime.js:118
    Babel 8
    runTests frame-runner.js:69
    t frame.js:55
    l runtime.js:63
    _invoke runtime.js:291
    S runtime.js:118
    Babel 4
    Oe frame.js:52
    t build.js:137
    Redux 15

I’m passing all the tests except for the assertions test though they come up green if I run them.
I’ve been looking through the files and I have found this { status : unavailabe} in fcc-testing.js, on line 57 to be exact.

  let error;
  app.get('/_api/get-tests', cors(), function(req, res, next){
    console.log(error);
    if(!error && process.env.NODE_ENV === 'test') return next();
    res.json({status: 'unavailable'});
  },

This seems to imply that the error is not caused by my tests but by the running of it and uncommenting NODE_ENV. This in its turn coincides with a new replit implementation of the .env file and about the time I suddenly did not pass this test anymore. I did so in the past.
In the console you can click framerunner.js and you land right into the code.

const test = await testPromise;
      if (typeof test === 'function') {
        await test(e.getUserInput);
      }
      return { pass: true };
    } catch (err) {
      if (!(err instanceof chai.AssertionError)) {
        console.error(err);
      }
      // to provide useful debugging information when debugging the tests, we
      // have to extract the message and stack before returning
      return {
        err: { message: err.message, stack: err.stack }
      };
    }

As I understand it, it says, if it’s not a Chai assertion error, console.error(err)

Which means that there may be no problem with my assertions and others are going to experience this as well.
I hope I’m wrong. But I think you have to look at this, to make sure.
This is a url to my replit : https://KarinMeersman-issuetracker-1.karinmeersman.repl.co

BTW, if you already know this, I suspect so, I did pass. Just once. Suddenly and then not anymore. Maybe there was some gracious soul that let me through the gates. Or it was fate or a glitch, anyway, whether it was You, Great Spirit in the Sky or a kind FCC engineer, thank you very much.

Greets,
Karin

I passed all tests, submitted and then I didn’t any more. EM is back.
No idea why.
I’m so glad I hit ‘submit’.

Hello there,

In order for the tests to run, NODE_ENV must be equal to 'test', and there must not be any error from your script that is not an assertion error.

So, if status: 'unavailable' is being returned, then one or both of those conditions is false. For most cases, the error is in the Camper’s test code (syntax errors). Or, sometimes, Campers need to RUN the app, and immediately submit their URL, in order to pass.

Without seeing your code, we cannot help further, and the link your provided shows a 404 - Repl not found page.

Hi,

I’ve been doing all that for days now.
There is a new implementation on replit. You cannot access the .env file directly anymore but you must click on a lock button and then enter key/value pairs.
It’s very easy but since that implementation, two days ago it started in the night, I’m not passing the tests anymore. I keep commenting and uncommenting NODE_ENV, I’ve tried all sorts of combinations. I just cannot pass anymore.

Also, NODE_ENV keeps disappearing. Each time I have to recreate the key/value pair. This is in part due to the fact that I keep forgetting to click on save, but even if I do that, often it’s just gone.
Either I comment it, and I run FCC’s test (and I passed that last one doing that in the past), or I uncomment and I can pass my own tests but FCC’s wont run properly.

I am running the code now, can you now see the tracker?

Also, I have added front end code (I don’t think it can interfere)

Thanks for reading and greetings,
Karin

The new feature on Replit of how environment variables are used does not affect this challenge. You are still able to set them, and able to remove/uncomment them.

Again… we cannot help further without more information

I keep commenting and uncommenting NODE_ENV, I’ve tried all sorts of combinations. I just cannot pass anymore.

Also, NODE_ENV keeps disappearing. Each time I have to recreate the key/value pair. This is in part due to the fact that I keep forgetting to click on save, but even if I do that, after three or so times of commenting and uncommenting, it’s just gone.
Either I comment it, and I run FCC’s test (and I passed that last one doing that in the past), or I uncomment and I can pass my own tests but FCC’s wont run properly.

I am running the code now, can you now see the tracker?

Also, I have added front end code (I don’t think it can interfere)

Please share the link to your project code.

Is it this ?

I always enter this to run the tests

https://karinmeersman-issuetracker-1.karinmeersman.repl.co/

I passed all the tests with your code:

  1. I cloned your project
  2. I added my DB_URI to the environment variables
  3. I added NODE_ENV=test to the environment variables
  4. I RAN the app
  5. I submitted and passed.
1 Like

Great,

Did you do that in replit?

Yes, I did it in Replit.

Greater still,
I’m going to do the same. If I pass, well I was doing all sorts of things when they were implementing it. Maybe mine got corrupted somehow.
Thank you very much
Karin

1 Like

I remember now,
Yesterday there was a warning pop up : ‘plugin crashed’ at some point. Big red letters, couldn’t get into my replit.
I had it again, just now. But I managed to copy the code into an new replit and passed.
Hurray!

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