Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

New Post: Cannot run generated unit test

$
0
0
I have created new NTVS project and added new Mocha JS unit test from template:
var assert = require('assert');

describe('Test Suite 1', function() {
    it('Test 1', function() {
        assert.ok(true, "This shouldn't fail");
    })

    it('Test 2', function() {
        assert.ok(1 === 1, "This shouldn't fail");
        assert.ok(false, "This should fail");
    })
})
Run it from VS2013. Jasmine test runner was launched in a browser with obvious error: "Uncaught ReferenceError: require is not defined". Indeed browser knows nothing about require().
So it doesn't work out of the box. How it is supposed to be run?

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>