Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running sls invoke test results in: the "path" argument must be of type string #19

Open
ldgarcia opened this issue Feb 11, 2018 · 6 comments

Comments

@ldgarcia
Copy link

ldgarcia commented Feb 11, 2018

I am currently using "serverless-jest-plugin": "^0.1.6" and "jest": "^22.2.2".

This is my config in serverless.yml:

custom:
  jest:
     roots:
      - '<rootDir>/tests'   

Running either sls invoke test or sls invoke test --path tests it outputs:

 FAIL  tests/customMessage.test.js
  ● Test suite failed to run

    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
      
      at assertPath (path.js:28:11)
      at Object.relative (path.js:1259:5)

 FAIL  tests/postConfirmation.test.js
  ● Test suite failed to run

    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
      
      at assertPath (path.js:28:11)
      at Object.relative (path.js:1259:5)

Test Suites: 2 failed, 2 total
Tests:       0 total
Snapshots:   0 total
Time:        0.483s
Ran all test suites.
@ldgarcia ldgarcia changed the title Running sls invoke test results in: the "path" argument must be of type string Running sls invoke test results in: the "path" argument must be of type string Feb 11, 2018
@TakaGoto
Copy link

+1

@BWoodfork
Copy link

Also running into this issue

@hmshoaib
Copy link

Any fix for this?

@abhishek-nair
Copy link

Hi Any update on this?

@brafdlog
Copy link

brafdlog commented Nov 9, 2018

This seems to be a problem in jest that was solved in version 21.x (see this).
I forked the repo and tried updating the jest version but then some of the tests failed with obscure errors. Tried bumping to version 23 and still didn't work.

@dhm116
Copy link

dhm116 commented Nov 15, 2018

This should be fixed now that Jest v23 is supported (I had been running into the same issues previously).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants