Skip to content

Docs: xref declare scoping in gotchas #973

@deliciouslytyped

Description

@deliciouslytyped

https://bats-core.readthedocs.io/en/stable/writing-tests.html#load-share-common-code states that using load with a script that has declares will result in the declares not being globally visible. I ran into this and found the above docs section after running around in circles a bit. Setting -g on the declare seems to have fixed the immediate problem. It would be nice if the gotchas page also had a reference to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: DocsPriority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsSize: SmallChanges to a few localized lines of code (e.g. same function)Status: ConfirmedThe reproducer worked as describedgood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions