A measurement of the ratio of branching fractions R(J/ψ) = (B+c → J/ψτ+ντ) / (B+c → J/ψμ+νμ) in the J/ψ → μ+μ−, τ+ → μ+μτν⎯⎯⎯τ decay channel is presented. This measurement uses a sample of proton-proton collision data collected at a center-of-mass energy of 13 TeV by the CMS experiment in 2018, corresponding to an integrated luminosity of 59.7 fb−1. The measured ratio, R(J/ψ) = 0.17 +0.18−0.17 (stat) +0.21−0.22 (syst) +0.19−0.18 (theo) = 0.17 ± 0.33, agrees with the value of 0.2582 ± 0.0038 predicted by the standard model, which assumes lepton flavor universality. By testing lepton flavor universality, this measurement is a probe of new physics using B+c mesons, which are currently only produced at the LHC.