Quality Assurance Projects - Metric-Imperial Converter

No I believe there is more than that. Although thanks for fishing that out.
Update: I have fixed it. Just a typo from when I was inserting “functionality” (Since we are taking it away).

You have not properly indented your tests within a suite to see the real issue.

See below where I copied/pasted your myApp.js code and added a few ATTENTION comments. Once you fix these, you should run npm run test and you will see one of the two tests you are still failing.

const chaiHttp = require("chai-http");
const chai = require("chai");
let assert = chai.assert;
const server = require("../server");
const { get } = require("../server");
const ConvertHandler = require("../controllers/convertHandler.js");
let convertHandler = new ConvertHandler();
chai.use(chaiHttp);
suite("Functional Tests", function () {
  suite("Valid Inputs", function () {
    test("convert a valid input", function (done) {
      chai
        .request(server)
        .get("/api/convert?input=10L")
        .end(function (err, res) {
          assert.equal(res.status, 200);
          assert.equal(
            res.text,
            '{"initNum":10,"initUnit":"L","returnNum":2.64172,"returnUnit":"gal","string":"10 litres converts to 2.64172 gallons"}'
          );
        });
      chai
        .request(server)
        .get("/api/convert?input=10gal")
        .end(function (err, res) {
          assert.equal(res.status, 200);
          assert.equal(
            res.text,
            '{"initNum":10,"initUnit":"gal","returnNum":37.8541,"returnUnit":"L","string":"10 gallons converts to 37.8541 litres"}'
          );
        });
      chai
        .request(server)
        .get("/api/convert?input=10kg")
        .end(function (err, res) {
          assert.equal(res.status, 200);
          assert.equal(
            res.text,
            '{"initNum":10,"initUnit":"kg","returnNum":22.04624,"returnUnit":"lbs","string":"10 kilograms converts to 22.04624 pounds"}'
          );
        });
          done();
        });
    });
    suite("Invalid inputs", function () {
      test("convert an invalid input", function (done) {
        chai
          .request(server)
          .get("/api/convert?input=2763galons")
          .end(function (err, res) {
            // assert.equal(res.status, 200);
            
              assert.equal(res.text, "invalid unit")
            ;
            done();
          });
      });
        // ATTENTION: need to close this test out
        test("convert an invalid number", function (done) {
          chai
            .request(server)
            .get("/api/convert?input=3/9/2kg")
            .end(function (err, res) {
              assert.equal(res.status, 200);
              assert(
                assert.equal(res.text, "invalid number") ||
                  assert.throws(function () {
                    convertHandler.getString("3/9/2kg");
                  }, Error)
              );
              done();
            });
        });
          // ATTENTION: need to close this test out
          test("convert an invalid number and unit", function (done) {
            chai
              .request(server)
              .get("/api/convert?input=3/9/2kgvthnh")
              .end(function (err, res) {
                assert.equal(res.status, 200);
                assert(
                  assert.equal(res.text, "invalid number and unit") ||
                    assert.throws(() => {
                      convertHandler.getString("3/9/2kgvthnh");
                    }, Error)
                );
                done();
              });
          });
        });
      // }); // ATTENTION: need to remove this closure
    // }); // ATTENTION: need to remove this closure
    suite("No Number Tests", function (done) {
      test("convert with no number", function (done) {
        chai
          .request(server)
          .get("/api/convert?input=mi")
          .end(function (err, res) {
            assert.equal(res.status, 200);
            assert.equal(
              res.text,
              '{"initNum":1,"initUnit":"mi","returnNum":1.60934,"returnUnit":"km","string":"1 miles converts to 1.60934 kilometers"}'
            );
            done();
          });
      });
    });
  });

Where is the code? I don’t see it.

Sorry about that. I edited my reply above.

The tests pass, but the fcc tests still do not. Can you please get them running.

Make sure after you run the tests with npm run test that you Ctrl-C to stop the tester. I would also, suggest you click Stop and Run again to make sure the app is up and running before you submit your url.

I am currently getting {"status":"unavailable"} when I try to go to get the test result from your live url at:

https://boilerplate-project-metricimpconverter-1.reneyibowei1.repl.co/_api/get-tests

When I clone your project and run it on my own replit and submit the tests, everything passes on the freeCodeCamp site. I have noticed that repl.it has been very slow today, so that could be causing some problems.

That might also explain why I was getting timeout errors on another project that i manually tested to be alright. Also I tried those things and there are still issues.

I need to get the fcc tests to pass

Are you sure you have added the required NODE_ENV environment variable with the value test? Make sure to Stop and Run again after adding it.

If this does not resolve the issue, then since I am able to fork your project and run it with the tests passing, I suggest you also create a new fork of your project and see if that will work for you. For some reason your existing repl.it has some kind of problem that only seems to be fixed when forked.