Using jQuery in cucumber tests?

I’m trying to write a test using xolvio:cucumber to verify that leading and trailing spaces are stripped from a textarea when clicking an OK button.

However, the getValue function provided by WebdriverIO already strips the spaces from the textarea. So even if the textarea really has the text " hello ", getValue() will always return “hello”.

A solution would be if I could use jQuery in my tests, since val() does not strip spaces. But I’ve never used node before, so I ran into a lot of trouble; at first I ran into the “jquery requires a window with a document” error so I added jsdom as well, but now my cucumber logs get filled with unclear error messages.

Does anyone know what steps I need to take to be able to use jQuery in my tests?