Monitoring Battery voltage using ESP8266 thinig dev board?
To read external voltage applied to ADC pin, use analogRead(A0). Input
  voltage range is 0 — 1.0V.  


Source: http://esp8266.github.io/Arduino/versions/2.0.0/doc/reference.html


Depending on voltage of the battery, you can build a simple voltage divider to convert 0 to V volts of battery to 0 to 1 V.
If power has to be saved, a high side switch can be used to measure battery voltage only when needed  




One example way of connecting the battery to ADC pin. Vin can be the battery point and Vout can be connected to a voltage divider. This will help to save power by not wasting power all the time via voltage divider. 

If it is only for code development, you can ignore the Switch circuitry. A simple voltage divider should be fine.







Simplest  

R1 and R2 are 80 kOhms and 15 kOhms respectively. For a max voltage of 6 V at Vin you will get 0.94 Volts at the ADC input pin (Vout).