Veliladon: The test kits include specific molecule which change the active ingredients in the drugs to other molecules which have specific colors. It may also have molecules which will interact with common adulterants to provide other information about how the drug is cut. If you don’t get a strong color indicated by the test it will often be because of impurities cutting the drug. You can use other tests to test for common adulterants if you want to figure out if they’re benign (i.e. cocaine cut with sugar) or scary af (cocaine cut with Levamisole).
That being said, the only way to know for sure is to use something like a mass spectrometer to measure the contents exactly.
henstepl: There exist very questional field tests for “purity” of heroin in which you apply a reagent to a specific amount (100mg?) and gauge its purity against a chart of how deep the color change is. I don’t know how many drugs they exist for.
But a test more ably done in the field rather than a professional lab is the addition of various reagents such as Ehrlich’s. This effects a color change which you can compare to a chart. https://www.reagent-tests.uk/wp/wp-content/uploads/2015/12/Raw-reagent-table.jpg