Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 589 Bytes

CONTRIBUTING.md

File metadata and controls

25 lines (22 loc) · 589 Bytes

contributing

tests

Unit tests are required for each new validator. Here is an example of a unit test that uses the available helpers.

func TestNoWhitespace(t *testing.T) {
    for _, test := range []testCase {
        {
            name: "pass",
            validator: NoWhitespace(),
            request: tfsdk.ValidateAttributeRequest{
                AttributeConfig: types.String{
                    Value: "no_whitespace",
                },
            },
        },
    } {
        t.Run(test.name, func(t *testing.T) {
            test.run(t)
        })
    }
}