My question is a sort of inverse of this one, where the OP asks whether a client may expect software tests as automatic deliverable in a software project. To me, that would imply a knowledgeable customer who knows that tests represent a percentage development cost that can help insulate against the surprise costs of regressions later on.
I'm looking to get started as a freelance developer, and I foresee the opposite problem. I think writing good software (unit/functional/etc) tests takes time, and since this is a substantial fraction of time spent it must be billed for. If we say that it takes 20% of a project's billable hours, clients may see this as an avoidable expense and ask for it to be removed from the schedule of work. For the freelance engineer, this may result in a loss of quality and a lower level of deployment confidence (neither of which are great if the freelancer is hired as a maintainer over the long term).
This answer suggests that the day rate should be high enough to effectively throw writing tests in for free. However, this may make estimates look uncompetitive, and I'd rather have the client know exactly what they're getting for their money. Thus, is it worth persuading clients of the value of this deliverable?