I am trying to setup Jasmine in IntelliJ IDEA with the jasmine-jstd-adapter plugin for JSTestDriver.
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:
1. you can use Add Jasmine JsTestDriver adapter
inspection to download the adapter:
Add JsTestDriver assertion framework support
and Add Jasmine JsTestDriver adapter
in Settings | Editor | Inspections JavaScript | JsTestDriver
.hit Alt+Enter
, specify the folder to download jasmine.js
and jasmineAdapter.js
to, press Add
2. 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.wiki
Note that WebStorm will download the library for you if you follow the steps described above