Skip to content

fix: fragile/vacuous assertions in oscat, codesys-import, located-variables tests #75

@michaeldistel

Description

@michaeldistel

3 tests with fragile or vacuous behaviour:

  1. tests/integration/oscat-gpp-compile.test.ts second test silently returns (not skips) if output from the first test is missing — can pass vacuously without running anything. Fix: use expect.fail() or it.skip().

  2. tests/library/codesys-import.test.ts — "V3 POU counts are comparable to V2.3" asserts expect(v3fn).toBe(v23fn) (exact equality of function counts between two different parsers). Brittle — breaks if either parser is updated. Fix: use toBeGreaterThan(0) or a tolerance check.

  3. tests/semantic/located-variables.test.ts — "should error on located variable in function block" asserts e.message.includes('FUNCTION_BLOCK'). Fragile string-contains on error message. Fix: assert on error code/type instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions