Amazon and General Motors are among companies exploring ways to test employees for COVID-19 infection, but these measures may be against the law.