Skip to content

test: check parser validation output#979

Open
999axel999 wants to merge 1 commit into
objectionary:masterfrom
999axel999:zerocracy/972-cover-invalid-parser-fast-fail
Open

test: check parser validation output#979
999axel999 wants to merge 1 commit into
objectionary:masterfrom
999axel999:zerocracy/972-cover-invalid-parser-fast-fail

Conversation

@999axel999

Copy link
Copy Markdown

Summary

  • Make the early parser-version validation test assert the specific validation output instead of duplicating the generic invalid-version test.
  • Assert that the Maven target directory is not created after the early parser validation failure.

Closes #972

Tests

  • node bootstrap + Mocha: test/commands/test_parse.js --grep 'validates parser version' -> 1 passing
  • node ..\objectionary__eoc_fix\node_modules\eslint\bin\eslint.js test\commands\test_parse.js with shared NODE_PATH -> passed
  • git diff --check -> passed
  • git merge-tree --write-tree origin/master HEAD -> passed

@999axel999 999axel999 marked this pull request as ready for review June 7, 2026 02:47
Comment on lines +84 to +92
assert(error, 'Command should fail with invalid version');
assert(
error.stderr.toString().includes(
'Parser version 999.999.999 is not available in Maven Central.'
),
error.stderr.toString()
);
assert.strictEqual(
fs.existsSync(path.resolve(home, 'target')),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it checks:
(a) an error was thrown,
(b) the stderr message content,
(c) the target dir absence
— three behaviors in one test. The early-validation behavior it claims to test is really (c); (a) and (b) are separate concerns already covered by the rejects invalid parser version test.

}
assert(error, 'Command should fail with invalid version');
assert(
error.stderr.toString().includes(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It asserts on an error message — explicitly forbidden.

@Thayorns

Copy link
Copy Markdown
Contributor

Also, unfortunately the issue is already closed

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.

Duplicate invalid-version tests in test_parse.js do not cover separate behaviors

2 participants