T
T
TempUserMain2014-07-01 10:14:49
JavaScript
TempUserMain, 2014-07-01 10:14:49

Why is ConsoleReporter() not being executed in Jasmine\\?

Jasmine v.2.0 + Karma v.0.12 is used to test the javascript code.
There is a jasmine test:

define(function() {

    describe("someTest", function () {

        it('someTest_Test', function () {

            var ConsoleReporter = jasmine.ConsoleReporter();
            var options = {
                timer: new jasmine.Timer,
                print: function () {
                    console.log.apply(console, arguments)
                }
            };
            var consoleReporter = new ConsoleReporter(options);
            jasmine.getEnv().addReporter(consoleReporter); 

            expect( "someText" ).toEqual( "someText" );

        });

    });

});

It is planned to use the console to output test results to the console.
However, as a result of executing the above code, an error is displayed:
"TypeError: undefined is not a function"
Can you please tell me how to solve the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question