yComponent.js
var m = require(&quot;mithril&quot;)

module.exports = {
    view: function() {
        return m(&quot;div&quot;, &quot;Hello world&quot;)
    }
}
</code></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="lang-javascript">var MyComponent = require(&quot;MyComponent&quot;)

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

    