Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

casperjs test cow-test.js undefined not a function evaluating casper.test.begin

I am using Windows. I am trying to use the CasperJS test framework.

I am using phantomjs version 1.9.0. I am using casperjs version 1.0.2.

When I run

casperjs test cow-test.js

The following is returned.

Test file: cow-test.js
FAIL TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
#    type: uncaughtError
#    error: "TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')"
TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
  C:/cow-test.js:16
FAIL 1 tests executed in 0.116s, 0 passed, 1 failed.

Details for the 1 failed test:

In cow-test.js:0
   uncaughtError: TypeError: 'undefined' is not a function 
   (evaluating  'casper.test.begin')
    var cow = {};
    test.assert(cow);
    test.done();
})')

If I do only

console.log(casper.test);

The following is returned

[object Object]

If I do only

console.log(casper.test.begin);

The following is returned.

undefined

What do I do? Do I supposed to run "casperjs test cow-test.js" from a specific directory?

Or, something else?

Thanks, Andre [email protected]

like image 998
Andre Mikulec Avatar asked Dec 20 '22 02:12

Andre Mikulec


1 Answers

You using stable version of casperjs while docs and code on site are for devel version 1.1

like image 179
Ilia Akhmadullin Avatar answered Apr 30 '23 02:04

Ilia Akhmadullin