Unfortunately the problem is it's connected to a voltage regulator, so it only 'sees' the regulated voltage. You'll be able to use code like that to see when the voltage starts to drop from 3.3v (meaning the LiPo voltage is near or below that), but by that time the battery is only 10% full or so.
NRF.getBattery() measures the voltage of the immediate source, which in your case is coming from the linear regulator which would then produce 3v3 for voltages higher than 3v3 (like your lipo for example).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I think Gordon already mentioned this:
NRF.getBattery()
measures the voltage of the immediate source, which in your case is coming from the linear regulator which would then produce 3v3 for voltages higher than 3v3 (like your lipo for example).There's also https://www.espruino.com/Tips+and+Tricks#common-issues-and-questions