mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 11:06:06 +00:00
f3e6480606
Four test files hand-wrote the stand-in pg_dump, pg_restore and psql scripts, each in its own shape, and read their arguments by position ($4, $6, args[3], slice(0, 5)). A change to what the tools are handed would have meant finding every one of them. tests/helpers/fake-pg-tools.ts installs the stand-ins: each logs its call, and what it does is a named snippet (answersSchema, answersTables, writesFile, writesRestrictedScript, listsMigrations, failsWith, touches, copiesFileEndingWith). The output file is found by its --file= argument. readToolCall and flagValues read a call back by name. pg-tools.test.ts moves onto it. Argument checks use arrayContaining and named flags; order is asserted only where it is the subject (the clear script runs before the load, `--` precedes the dump path). PGTOOLS-007 and PGTOOLS-009 split their scenarios into it.each, keeping their IDs as suffixes.