2

I've just followed the CodeceptJS Quickstart and opened first_test.js in the PhpStorm IDE (equivalent to WebStorm, IntelliJ, etc.).

For all the built-in functions, I'm getting "Unresolved function or method …":

enter image description here

I also don't get any autocompletion on I.

I've tried the following.

  1. Looked for a CodeceptJS plugin. Didn't find any.
  2. Enabled codeceptjs/node_modules in Settings -> Languages & Frameworks -> JavaScript -> Libraries.
  3. Set JavaScript language version to ECMAScript 6.
  4. Enabled the Node.js Core library.
  5. Restarted PhpStorm.
Yngve Høiseth
  • 508
  • 6
  • 21

1 Answers1

2

Please run 'npm install codeceptjs'.

Oksana
  • 492
  • 2
  • 2
  • Great, thanks. I find it a bit strange that this makes a difference, considering that I have installed `codeceptjs-webdriverio` which in turn depends on `codeceptjs`. – Yngve Høiseth Sep 28 '17 at 19:29
  • 3
    @YngveHøiseth As I understand it's the way how IDE is indexing the `node_modules` -- it only indexes modules that YOU are required (in your `package.json` or whatever that file is) and ignores packages (excludes folders) if they are not used directly (e.g. used by other libs internally). This is to avoid polluting completion with most-likely-unneeded-for-you libs/functions (since they may be used only inside that lib). If you need something -- require it directly (make it your direct dependency). – LazyOne Sep 29 '17 at 13:34
  • This does not fix the problem. The functions are not imported and phpstorm will still think they are non existant – gempir Jun 26 '19 at 11:47