Skip to content

Commit

Permalink
fix: dry run of assertions failing (#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish10alex committed Jul 8, 2024
1 parent 4015b05 commit d3d0194
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/api/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export class Runner {
if (task.type === "assertion") {
// We expect that an assertion query returns 1 row, with 1 field that is the row count.
// We don't really care what that field/column is called.
const rowCount = rows[0][Object.keys(rows[0])[0]];
const rowCount = rows[0]?.[Object.keys(rows[0])[0]];
if (rowCount > 0) {
throw new Error(`Assertion failed: query returned ${rowCount} row(s).`);
}
Expand Down

0 comments on commit d3d0194

Please sign in to comment.