If you have removed all but one of these statements (you do have in your code exports.PersonModel = Person;), you won’t pass the other tests because in server.js (which you should also NOT edit), the above exports are imported and used like this: var createPerson = require('./myApp.js').createAndSavePerson;
So, if you’ve removed those exports, and in particular for this test - exports.createAndSavePerson = createAndSavePerson; , there’s no way to pass this test or any of the subsequent ones.
Thank you, that solved “createPerson is not a function” error. Still having issues with this challenge though, now I’m getting “Timeout has occured” error again.
Yes I edited server.js file to try to make it work because all the other excercises were working good (I’ve completed rest of the course and 4/5 projects)
You’re free to do what you like, but at the very top of server.js it says:
/********************************************
* DO NOT EDIT THIS FILE
* the verification process may break
*******************************************/
Anyway, as a quick check, try changing your schema so that your array in ‘favoriteFoods’ isn’t untyped.
An example from the Mongoose docs:
var ToySchema = new Schema({ name: String });
var ToyBoxSchema = new Schema({
toys: [ToySchema],
buffers: [Buffer],
strings: [String],
numbers: [Number]
// ... etc
});
I’m not sure if it’ll fix your problem, but it caused me problems before. Once I defined favoriteFoods as an array of strings, things worked.
Hi @SirRobLyon, were you able to solve this issue because I’ve spent 2 days dealing with this weird, “Done() argument missing” error. I’ve copied code from other coders who claimed that it’s working for them but I’m facing the same error.
Never touched server.js file.
Can you tell me how did you solve this issue? Of course, if you solved it.