ReferenceError: goog not detected when starting Jasmine

I tried to run the tests presented in the shaka-player source code using the Jasmine structure through the command line. But I get an 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 set up the jasmine.json file by placing the same input that the unit_tests.html file needs to run the tests in the browser. I also compiled all the source code by running the build / build.sh script, and I also put the compiled code in the input list. The jasmine.json file looks 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 jasmine using JASMINE_CONFIG_PATH as shown below:

jasmine JASMINE_CONFIG_PATH=spec/support/jasmine.json

What am I doing wrong?

Thanks in advance.

+4
source share

Source: https://habr.com/ru/post/1607035/


All Articles