Skip to content

Document best practices for testing script-based styles #83

@ptgott

Description

@ptgott

Check for existing issues

  • Completed

Describe the feature

I am currently evaluating Vale as a prose linting solution, and noticed that the script extension point allows organizations to enforce style rules that do not correspond with one of the other extension points.

I was hoping the Vale docs could describe the intended best practice for testing Tengo scripts included in script-based rules. When writing linters for prose, I would want to account for edge cases and, when accommodating new ones, prevent regressions, and I'm guessing it will be a lot easier to write script-based rules with a test suite.

From the current docs, it looks like there's no Vale-native way to import script scripts into a test runner to execute against minimal inputs. I guess it's possible to use a custom approach. For example, a project could store Tengo files separately from the Vale config. This way, the project could have a Tengo test runner load these files for testing. Then a script could insert the Tengo files into their associated Vale configurations. This seems a little complicated, though, so it be nice to know if there is a recommended way to test script scripts!

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