function test(filename, project) {
  return new Promise(function(resolve, reject) {
    const results = [];
    let validator = new JSONValidator();
    validator.addSchema(LINK, LINK.id);
    validator.addSchema(ATTRIBUTE, ATTRIBUTE.id);
    validator.addSchema(TOC_ELEMENT, TOC_ELEMENT.id);
    validator.addSchema(LOWER_TABS, LOWER_TABS.id);
    validator.addSchema(UPPER_TABS, UPPER_TABS.id);
    validator.addSchema(TOC_OTHER, TOC_OTHER.id);
    validator.addSchema(TOC_MENU, TOC_MENU.id);
    validator.validate(project, BOOK_ROOT).errors.forEach((err) => {
      let msg = `${err.stack || err.message}`;
      msg = msg.replace('{}', '(' + err.instance + ')');
      const result = {
        level: 'ERROR',
        filename: filename,
        message: msg,
      };
      results.push(result);
    });
    if (results.length > 0) {
      reject(results);
      return;
    }
    resolve(true);
  });
}
Tests and validates a _project.yaml file.
  Note: The returned promise always resolves, it will never reject.

@param {string} filename The name of the file to be tested.
@param {Object} project The parsed contents of the project file.
@return {Promise} A promise with the result of the test.