nwesterman / mochaExitCode_3893

Project to reproduce https://github.com/mochajs/mocha/issues/3893
0 stars 0 forks source link

Same results every run (WOMM) #2

Open plroebuck opened 5 years ago

plroebuck commented 5 years ago
$ npm test

> issue-3893@1.0.0 pretest /tmp/issue-3893
> /bin/echo -n 'Mocha v' && mocha --version

Mocha v6.1.4

> issue-3893@1.0.0 test /tmp/issue-3893
> mocha

  LinkListBuilder
    1) Guaranteed Error
    XSD Compliance

      2) Test 1

      3) Test 2

      4) Test 3

      5) Test 4
      6) Guaranteed Error

  joi
    Joi.Validate()
      ✓ Doesn't set errors on expected values
      Required/Optional
        ✓ Notes an error if a required value is missing
        ✓ Does not set an error if an optional value is missing
        ✓ Defaults to optional
      Joi conversion
        ✓ Converts numeric strings to numbers
        ✓ Converts 'true'/'false' strings to bools
        ✓ Converts JSON strings to objects
        ✓ Converts a string containing an array to an actual array
      Joi.Number()
        ✓ Does set errors when given bools for numbers
        ✓ Does throw errors when given objects for numbers
        ✓ Does throw errors when given arrays for numbers
      Joi.String()
        ✓ Does throw errors when given numbers for strings
        ✓ Does throw errors when given objects for strings
        ✓ Does throw errors when given bools for strings
        ✓ Does throw errors when given arrays for strings
      Joi.Object()
        ✓ Does throw errors when given numbers for objects
        ✓ Does throw errors when given bools for objects
        ✓ Does throw errors when given arrays for objects
      Joi.Boolean()
        ✓ Does throw errors when given numbers for bools
        ✓ Does throw errors when given objects for bools
        ✓ Does throw errors when given arrays for bools
      Joi.Array()
        ✓ Does throw errors when given numbers for arrays
        ✓ Does throw errors when given objects for arrays
        ✓ Does throw errors when given booleans for arrays
      Max
        ✓ Accepts short enough values
        ✓ Rejects longer values
      Truncate
        ✓ Accepts short enough values
        ✓ Accepts longer values, returns truncated value
    Our Entity Application
      ✓ Stores any applied Joi conversions as proper values
      ✓ Truncates too long of strings
      Nested Entities
        ✓ Winds up with all values converted
        ✓ Rejects error in parent level
        ✓ Rejects error in child level

  Xmllint

    7) Test 1

    8) Test 2
    9) Guaranteed Error

    10) Test 3

  highest-random-weight
    hrw
      ✓ returns expected values
    choose
      ✓ chooses among the various values
      11) Guaranteed Error
      ✓ is not affected by order
      ✓ Does not error an empty array

  boundary
    12) should use error status code, if ones provided
    ✓ should return a 500 if a node-error.code is generated
    ✓ should return 500 if a >599 error code is set
    ✓ should return 500 if a <500 error code is set
    ✓ should return a 500 if no error info is provided
    ✓ returns json via res.json

  42 passing (2s)
  12 failing

  1) LinkListBuilder
       Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false

      at Context.it (test/1taskdataLinklist.test.js:40:41)

  2) LinkListBuilder
       XSD Compliance
         Test 1:

      Test 1
      + expected - actual

       {
      -  "errors": [
      -    "file_0.xml:1: element Taskdata: Schemas validity error : Element 'Taskdata': The attribute 'DataTransferOrigin' is required but missing."
      -  ]
      +  "errors": [null]
       }

      at Context.it (test/1taskdataLinklist.test.js:47:20)

  3) LinkListBuilder
       XSD Compliance
         Test 2:

      Test 2
      + expected - actual

       {
      -  "errors": [
      -    "file_0.xml:1: element Taskdata: Schemas validity error : Element 'Taskdata': The attribute 'DataTransferOrigin' is required but missing."
      -  ]
      +  "errors": [null]
       }

      at Context.it (test/1taskdataLinklist.test.js:55:20)

  4) LinkListBuilder
       XSD Compliance
         Test 3:

      Test 3
      + expected - actual

       {
      -  "errors": [
      -    "file_0.xml:1: element Taskdata: Schemas validity error : Element 'Taskdata': The attribute 'VersionMajor' is required but missing."
      -  ]
      +  "errors": [null]
       }

      at Context.it (test/1taskdataLinklist.test.js:63:20)

  5) LinkListBuilder
       XSD Compliance
         Test 4:

      Errors in main file
      + expected - actual

       {
      -  "errors": [
      -    "file_0.xml:1: element Taskdata: Schemas validity error : Element 'Taskdata': The attribute 'VersionMajor' is required but missing."
      -  ]
      +  "errors": [null]
       }

      at Context.it (test/1taskdataLinklist.test.js:71:20)

  6) LinkListBuilder
       XSD Compliance
         Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false

      at Context.it (test/1taskdataLinklist.test.js:73:45)

  7) Xmllint
       Test 1:

      AssertionError: expected { Object (errors) } to deeply equal { errors: [ 'something or another' ] }
      + expected - actual

       {
         "errors": [
      -    "file_0.xml:1: element TEST: Schemas validity error : Element 'TEST': No matching global declaration available for the validation root."
      +    "something or another"
         ]
       }

      at Context.it (test/3xmllint.test.js:44:16)

  8) Xmllint
       Test 2:

      AssertionError: expected { Object (errors) } to deeply equal { errors: null }
      + expected - actual

       {
      -  "errors": [
      -    "file_0.xml:1: element Taskdata: Schemas validity error : Element 'Taskdata': The attribute 'DataTransferOrigin' is required but missing."
      -  ]
      +  "errors": [null]
       }

      at Context.it (test/3xmllint.test.js:51:16)

  9) Xmllint
       Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false

      at Context.it (test/3xmllint.test.js:53:41)

  10) Xmllint
       Test 3:

      AssertionError: expected { Object (errors) } to deeply equal { errors: null }
      + expected - actual

       {
      -  "errors": [
      -    "file_0.xml:2: element Taskdata: Schemas validity error : Element 'Taskdata': The attribute 'VersionMajor' is required but missing."
      -  ]
      +  "errors": [null]
       }

      at Context.it (test/3xmllint.test.js:60:16)

  11) highest-random-weight
       choose
         Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false

      at Context.it (test/4highest-random-weight.test.js:58:45)

  12) boundary
       should use error status code, if ones provided:

      AssertionError: expected 500 to equal 418
      + expected - actual

      -500
      +418

      at Context.it (test/5errorFormat.test.js:74:16)

npm ERR! Test failed.  See above for more details.
$ 
plroebuck commented 5 years ago

12) caused by determineErrorCode converting its err argument into an array, then checking for err.code.