If you are using the default testEnvironment, then you are using jsdom.
You can check this issue to see why it is not implemented in jsdom :
https://github.com/tmpvar/jsdom/issues/1245
The primary issue is the fact that innerText leans on the layout engine for guidance, and jsdom has no layout engine
If you want “full” browser support you can check puppeteer