Skip to content

Add invalid-JSON test for append-run-log - #491

Open
shaurya703 wants to merge 1 commit into
cobusgreyling:mainfrom
shaurya703:test/481-append-run-log-invalid-json
Open

Add invalid-JSON test for append-run-log#491
shaurya703 wants to merge 1 commit into
cobusgreyling:mainfrom
shaurya703:test/481-append-run-log-invalid-json

Conversation

@shaurya703

Copy link
Copy Markdown

Fixes #481

Adds scripts/append-run-log.test.mjs locking in the behaviour from #474:

  • Invalid second arg (not JSON) exits with code 1 and prints a Usage message mentioning valid JSON (no stacktrace)
  • A valid minimal JSON entry parses and appends to a temp loop-run-log.md without throwing (temp file created and cleaned up inside the test — the real run log is untouched)

Run with:

node --test scripts/append-run-log.test.mjs

Results: 2 tests, 2 pass, 0 fail.

- Invalid second arg exits 1 and prints a Usage message mentioning
  valid JSON
- Valid minimal JSON entry appends to a temp log without throwing
- Run with: node --test scripts/append-run-log.test.mjs

Fixes cobusgreyling#481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add invalid-JSON test for append-run-log

1 participant