Yeah it works the same as iPhone X, Xs, X Max, and XR. The FaceID camera uses infrared to map your face, not surrounding light. So darkness doesn’t matter. I haven’t even been effected by direct sunlight with it either.
Just make sure your face isn't too close. This often happens with me and my iPhone X/XS.. Face ID often fails in the middle of the night until I realize I'm holding the phone too close to my face. has to be about half arm's length or so.
Heh, just tried this in total darkness, wearing my glasses (I set it up without them), and it opened faster than it does in full light. Pretty neat thing they’ve built here.