-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation for test csv formats #980
Conversation
3b85c16
to
4dd172a
Compare
0b5d9b4
to
c4ee792
Compare
lib/data/process-test-directory.js
Outdated
const firstRowKeysLength = Object.keys(rawCSV[0]).length; | ||
for (; index < rawCSV.length; index++) { | ||
if (!rowValidator(rawCSV[index])) { | ||
printError('validator returned false result'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validators signal failure by throwing errors, so this branch seems unreachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this was a secondary idea to catch any other validation situation, then I made it throw errors for better output. I still think an undefined
or falsy result from this "validator" should be an error, though none of our code is using this path currently
Co-authored-by: jugglinmike <mike@mikepennisi.com>
2643375
to
7b671ce
Compare
Preview Tests
create-example-tests
toprocess-test-directory
in the lib folderSome example errors from testing various ways of breaking commands.csv
typo in commands.csv header row:
typo in command.csv command
typo in commands.csv task name
Mismatch of columns between entries in CSV: