To be a bedroom it has to have a window, a certain size (which varies), and some places even require a closet in the room.
If they find a bed in a room like that they normally start with a warning, then a visit from child protection services, or even condemning the entire house.
Obviously if they don't inspect they'll never know, but rentals, and people with contact with authority (CPS, Police, etc) could expect an inspection.
If you own, I'm not sure if the fire department can legally enter a home for an inspection without a warrant, but for a rental I believe they can, and do!