/* This is a test that fails right now. Because we called "coffins.import" once in the server tests, and once in the client tests, and they imported the same csv file twice. WHAT SHOULD WE DO ABOUT THAT? */
it("There should be NO DUPLICATE coffins", function(done) {
const allCoffins = Coffins.find();
// What is unique in a coffin? Well, the bib_num is surely unique.
// So no two coffins should have the same bib_num.
// make an array of all bib_nums.
const bib_nums = [];
allCoffins.forEach(function(coffin){
// is this coffin's bib_num already in our array? shouldn't be.
assert.ok(bib_nums.indexOf(coffin.bib_num) === -1, "bib_num should be unique");
// then put this bib_num in our list
bib_nums.push(coffin.bib_num);
console.log(bib_nums);
});
// if we got through the list with no assertion failures, its good.
done();
});
This the result of my failed test!