Am writing tests for a terraform provider and have read the docs for testing (https://www.terraform.io/docs/extend/best-practices/testing.html#expecting-errors-or-non-empty-plans) but I don’t understand the process for asserting on errors from the provider.
For example- in the case of the provider I’m building- if the user provides an invalid value for one of the fields that the provider supports (i.e. puts no instead of false for the immediate field)- the api that the provider calls responds with the following error: "Error: “channels.immediate” must be [false]. “channels.immediate: must be a boolean”. However, passing this error in under ExpectError- I’m unable to assert on the value of this error. I am however able to assert that a required field is missing.
My current test suite can be found here:
I also tried the suggestions on this github issue here: https://github.com/hashicorp/terraform/issues/15469