eykrehbein / strest

⚡️ CI-ready tests for REST APIs configured in YAML
MIT License
1.74k stars 59 forks source link

TypeError: Cannot read property 'hex' of undefined #149

Open g5becks opened 3 years ago

g5becks commented 3 years ago

Describe the bug Getting error TypeError: Cannot read property 'hex' of undefined

To Reproduce

Run "@strest/cli": "^2.5.1",

on Ubuntu 20.0.4

using node --version v14.15.3

with the following file

version: 2

variables: # Define variables here
  testUrl: http://127.0.0.1:8000
  to_log: true

requests:
  addUser:
    request:
      url: <$ testUrl $>/userMutations/addUser
      method: POST
      postData:
        mimeType: application/json
        text:
          name: <$ Faker("name.firstName") $>
          guid: <$ Faker("uuid") $>
    validate:
      - jsonpath: status
        regex: 2\d+
      - jsonpath: content.path.to.var
        expect: expect_value
  log: <$ to_log $>

-----------------------------------
$ strest api.strest.yml

Expected behavior Expect test to run.

Full error below.

(node:2587049) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hex' of undefined
    at Object.exports.colorizeMain (/home/g5becks/Dev/poppn/node_modules/@strest/cli/dist/handler.js:127:28)
    at /home/g5becks/Dev/poppn/node_modules/@strest/cli/dist/handler.js:71:51
    at step (/home/g5becks/Dev/poppn/node_modules/@strest/cli/dist/handler.js:33:23)
    at Object.next (/home/g5becks/Dev/poppn/node_modules/@strest/cli/dist/handler.js:14:53)
    at fulfilled (/home/g5becks/Dev/poppn/node_modules/@strest/cli/dist/handler.js:5:58)