title: IntelliJ Kotlin/JS Mocha Unit Testing Unavailable via Plugin
body: <p>I am experiencing some difficulty getting IntelliJ to recognize my Kotlin Tests as mocha tests and generating the green play button in the gutter allowing me to run Kotlin/JS unit tests in the IDE via the Mocha Plugin. Now, I somehow managed to get this working after some trial and error and then inexplicable earlier today it just stopped working and the green play buttons vanished from the gutter. I have tried all the normal stuff such as invalidating the IDE cache, removing .idea/*.iml files and reimporting project. Nothing seems to work.</p>
  
  <p><strong>Image of Working Environment</strong></p>
  
  <p>here is an image of the setup working as expected that I luckily took a snapshot of while I had the chance because I had so much difficulty getting it working.</p>
  
  <p><a href="https://i.stack.imgur.com/ZHNPj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZHNPj.png" alt="enter image description here"></a></p>
  
  <p>You can also see that the mocha run configuration is accurately picking up on the fact that the actual file being ran is going to be the output file in my build directory. </p>
  
  <p><a href="https://i.stack.imgur.com/jVXB9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jVXB9.png" alt="enter image description here"></a></p>
  
  <p>My initial instinct led me to believe that this was due to IntelliJ picking up on my map.js files being generated as well, however this is not the case as did not (and do not) have my compile options set to with <em>sourceMap = true</em> or <em>sourceMapEmbedSources = "always"</em>, as you can see from this snippet from my build.gradle.kts</p>
  
  <pre><code>compileKotlin2Js {
      kotlinOptions {
          moduleKind = "commonjs"
      }
  }
  compileTestKotlin2Js {
      kotlinOptions {
          moduleKind = "commonjs"
      }
  }
  </code></pre>
  
  <p>For the record, my gradle build compiles and tests run successfully. To clarify, I am specifically trying to get IntelliJ to recognize the project structure in such a way that the run configurations can make these education decisions for me and speed up my workflow.</p>