I am trying to setup Jasmine in IntelliJ IDEA with the jasmine-jstd-adapter plugin for JSTestDriver.
- JSTD Plugin is installed
- jasmine was npm-installed globally (so it resides in %APPDATA%\npm\node_modules\jasmine)
- jasmine.js file from the npm install was added to JS libraries in the IDEA settings with global scope.
I have the following package structure inside IDEA:
-myProject\ -- .idea\ {...} -- myTest.js -- myTest.spec.js -- test.jstd -External Libraries\ -- jasmine\ --- jasmine.js
Now I have no idea how to structure my config file. Currently it looks like this, because the Jetbrains help did tell me so:
load:
- "lib/jasmine/jasmine.js"
- "lib/jasmine-jstd-adapter/JasmineAdapter.js"
- "*.js"
test:
- "*.spec .js"
But it fails to open the jasmine scripts, when executing the JSTD run configuration:
Cannot read C:\Users\danie\Documents\ExercismProjects\javascript\simple-cipher\lib\jasmine\jasmine.js derived from lib/jasmine/jasmine.js
Cannot read C:\Users\danie\Documents\ExercismProjects\javascript\simple-cipher\lib\jasmine-jstd-adapter\JasmineAdapter.js derived from lib/jasmine-jstd-adapter/JasmineAdapter.js
My questions:
- Don't I have to add the jasmine-jstd-adapter.js as well somewhere? Where do I find it?
- How do I load the library files? They are obviously not in \lib\, because there is no lib folder. So how do I refer to the "External Libraries"?
- What else am I missing?
1. you can use
Add Jasmine JsTestDriver adapter
inspection to download the adapter:Add JsTestDriver assertion framework support
andAdd Jasmine JsTestDriver adapter
inSettings | Editor | Inspections JavaScript | JsTestDriver
.hit
Alt+Enter
, specify the folder to downloadjasmine.js
andjasmineAdapter.js
to, press Add2. There is no way to use IDE External libraries here - the latter are only used by the IDE itself for code completion/type hinting and are not available to JsTestDriver test runner. Library files have to be placed in your project and referenced in
"load"
section using URLs relative to configuration file. Note that http urls are also supported - see https://code.google.com/archive/p/js-test-driver/wikis/ConfigurationFile.wikiNote that WebStorm will download the library for you if you follow the steps described above