Hello,
I am having issues with submitting my American British Translator project.
On my server it passes all 30 tests required (24 unit tests, 6 functional tests).
However when uploading to the below link, it says I didn’t pass the two requirements:
" All 24 unit tests are complete and passing. See /tests/1_unit-tests.js
for the expected behavior you should write tests for."
“All 6 functional tests are complete and passing. See /tests/2_functional-tests.js
for the functionality you should write tests for.”
Link: Project URL
See these two screenshots if it is still unclear:
I’m not the best at formatting forum text but here goes, see the below two examples from my code to see the structure of how I test (first a unit test then a functional test).
test("Highlight translation in Paracetamol takes up to an hour to work.", function() {
assert.strictEqual(t.translate("Paracetamol takes up to an hour to work.", true), '<span class="highlight">Tylenol</span> takes up to an hour to work.');
});
test("Translation with text that needs no translation: POST request to /api/translate", function(done) {
chai
.request(server)
.post("/api/translate")
.send({
'text': "Mangoes are my favourite fruit.",
'locale': "american-to-british"
})
.end(function(err, res) {
assert.strictEqual(res.text, '{"text":"Mangoes are my favourite fruit.","translation":"Everything looks good to me!"}');
done();
});
});
I am also very confused why this is not working, as I basically copied the structure from one of my other projects in the same certificate that has been approved.
I hope one of you will be able to help me as this is the last thing that needs to be corrected before I have finished this certification, so I’m really looking forward to it!
Thank you very much in advance,
Andreas