# Goodness of Fit Test for Logistic Regression with small n_i

I would like to test how well my model fits the data. The response is binary and the Chi-Squared Test cannot be applied for the residual deviance because the $n_i$ are $1$. To use the Chi-Squared GOF Test, the $n_i$ need to be $\geq 5$. What's an alternative method can I use to test for goodness of fit?

e.g. in R, see the examples under ?glm and ?anova.glm