Como obter o valor expandido da ARIA em JavaScript

document.getElementById('test').getAttribute('aria-expanded')
Thoughtful Tarsier