Hello all, I’ve created a tool called vue-test-declarative to write component tests in a new way. I’ve created a new file format, .vuetest, that allows you to write units tests - declaratively!
Here is an example test:
<it will="add a todo"> <set selector=".new-todo" value="First" /> <trigger selector=".new-todo" event="keyup.enter" /> <expect text-of=".todo-list li" to-match="First" /> <expect text-of=".todo-count" to-match="1 item left" /> </it>
And yes, you can add a
<script> tag, like in a .vue file, to bind data/props to your declarative tests.
Much more detail in the github repo.