We compute opacities for the electronic molecular band systems A6Σ+–X6Σ+ of CrH and CrD, and A2Π–X2Σ+ of MgH and MgD. The opacities are computed by making use of existing spectroscopic constants for MgH and CrH. These constants are adjusted for the different reduced masses of MgD and CrD. Frank–Condon factors are used to provide intensities for the individual vibronic bands. These results are used in the computation of synthetic spectra between Teff= 1800 and 1200 K with an emphasis on the realization of ‘deuterium test’, first proposed by Bejar et al. to distinguish brown dwarfs from planetary mass objects. We discuss the possible use of CrD and MgD electronic bands for the ‘deuterium test’. We find CrD to be the more promising of the two deuterides, potentially, the most useful bands of CrH/CrD are the Δv=+1 and Δv=−1 at 0.795 and 0.968 μm.