Skip to content

Make snapshot tests resiliant to Stylelint internal changes #140

Description

@romaricpascal

What

Ignore private properties returned by resolveConfig in the snapshot tests and make the ordering of keys stable.

Note

Stylelint has a omitPrivateProperties utility to ignore private properties when stringifying config to JSON for printing with --print-config in the CLI

Why

Snapshot tests keep an eye on the config created by our own rules and those of the config we extend. They run Stylelint's resolveConfig, which returns not only the public list of rules and plugins, but also private properties used internally by Stylelint.

These tests shouldn't break if Stylelint decides to update how it functions internally, so we should be resilient to changes in private properties and ordering of the keys in the generated config.

Done when

  • Snapshot ignores Stylelint's private properties in the config and use a consistent order for the keys

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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