pre>
<p>We can then create a <code>tests/MyComponent.js</code> file and create a test for this component like this:</p>
<pre><code class="language-javascript">var MyComponent = require(&quot;MyComponent&quot;)

o.spec(&quot;MyComponent&quot;, function() {
    o(&quot;returns a div&quot;, function() {
        var vnode = MyComponent.view()

        o(vnode.tag).equals(&quot;div&quot;)
        o(vnode.children.length).equals(1)
        o(vnode.children[0].tag).equals(&quot;p&quot;)
        o(vnode.children[0]