Do dollar store tests really work??

Abby
So I am late on my period so I bought a couple tests just from the dollar tree.   I took one last night and it was invalid.  Took the second one today and it's positive.   The test was only $1 so idk if it actually works or not?? Going to get a more expensive one today but just wanted your advice