A
A
Arthur2017-08-24 16:45:25
Software testing
Arthur, 2017-08-24 16:45:25

How to test part of the code through Mocha.js?

I delve into js and testing, a question arose.
There is a script with different functions - script.js;
installed nodejs with chai.js and mocha.js;

var assert = require('assert');
describe('Cookies', function() {
    describe('viewCookie()', function() {
        it('should return undefined', function() {
            assert.equal(undefined, viewCookie());
        });
    });
});

how to properly run test of only one function from script.js? and how to access it correctly from the directory where the test is located?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rustler2000, 2017-08-24
@rustler2000

'''mocha -g Cookies'''
The page says in the startup section

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question