5

I tried to execute the tests present in shaka-player source code, using the Jasmine framework via command line. But I'm getting this error message:

/Documents/shaka-player/spec/mpd_spec.js:19
goog.require('shaka.dash.mpd');
^
ReferenceError: goog is not defined
    at Object.<anonymous> (/Documents/shaka-player/spec/mpd_spec.js:19:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at /usr/lib/node_modules/jasmine/lib/jasmine.js:63:5
    at Array.forEach (native)
    at Jasmine.loadSpecs (/usr/lib/node_modules/jasmine/lib/jasmine.js:62:18)

I configured the jasmine.json file, putting the same input that is needed by unit_tests.html file to execute the tests in the browser. I have also compiled the entire source code, executing the build/build.sh script, and I also put the compiled code at the input list. The jasmine.json file is like:

{
"spec_dir": "spec",
"spec_files": [
    "mpd_spec.js",
    "util.js"
],
"inputs": [
    "shaka-player.compiled.js",
    "third_party/jasmine/lib/jasmine-2.1.3/jasmine.js",
    "third_party/jasmine/lib/jasmine-2.1.3/jasmine-html.js",
    "third_party/jasmine/lib/jasmine-2.1.3/boot.js",
    "third_party/jasmine/lib/jasmine-ajax-3.1.0/mock-ajax.js",
    "third_party/blanket_jasmine/blanket_jasmine.js",
    "third_party/closure/goog/base.js"
   ]
}

I executed the jasmine using the JASMINE_CONFIG_PATH, as follow:

jasmine JASMINE_CONFIG_PATH=spec/support/jasmine.json

What I'm doing wrong?

Thanks in advance.

0 Answers0