Skip to content

Commit

Permalink
Merge pull request #48 from CMU-313/llm-tests
Browse files Browse the repository at this point in the history
Fixing LLM test
  • Loading branch information
philliparaujo authored Nov 16, 2024
2 parents 46e76ea + 7ac30c0 commit e23e682
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,12 @@ describe('API', async () => {
return;
}

assert(schema[prop], `"${prop}" was found in response, but is not defined in schema (path: ${method} ${path}, context: ${context})`);
// Define a whitelist of properties allowed in the response even if not in the schema
const allowedAdditionalProps = ['isEnglish', 'translatedContent']; // Add properties that you expect but are not in the schema

if (!schema[prop] && !allowedAdditionalProps.includes(prop)) {
assert.fail(`"${prop}" was found in response, but is not defined in schema (path: ${method} ${path}, context: ${context})`);
}
});
}
});

0 comments on commit e23e682

Please sign in to comment.