Giter Club home page Giter Club logo

mochaexitcode_3893's People

mochaexitcode_3893's Issues

Still WOMM using your GitLab repo...

npm test

> [email protected] pretest /var/tmp/issue-3893
> /bin/echo -n 'Mocha v' && mocha --version

Mocha v6.1.4

> [email protected] test /var/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

  LinkListBuilder 2
    7) Guaranteed Error
    XSD Compliance
 
      ✓ Test 1
 
      ✓ Test 2
 
      ✓ Test 3
 
      ✓ Test 4
      8) 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
 
    ✓ Test 1
 
    ✓ Test 2
(node:17218) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 uncaughtException listeners added. Use emitter.setMaxListeners() to increase limit
    9) Guaranteed Error
 
    ✓ Test 3
(node:17218) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit

  Once more Xmllint
 
    10) Test 1
 
    11) Test 2
    12) Guaranteed Error
 
    13) Test 3

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

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

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

  boundary
    17) 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
    ✓ request body is returned in _object, if one was sent
    ✓ returns json via res.json
    ✓ error stacks are returned as an array

  boundary-joi-errors
    18) should return a 400 for Joi Validation errors
    19) should return a 400 if any error is Joi


  59 passing (1s)
  19 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) LinkListBuilder 2
       Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false
      
      at Context.it (test/1taskdataLinklist.test.js:79:41)

  8) LinkListBuilder 2
       XSD Compliance
         Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false
      
      at Context.it (test/1taskdataLinklist.test.js:112:45)

  9) Xmllint
       Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false
      
      at Context.it (test/3xmllint.test.js:53:41)

  10) Once more 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:70:16)

  11) Once more 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:77:16)

  12) Once more Xmllint
       Guaranteed Error:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false
      
      at Context.it (test/3xmllint.test.js:79:41)

  13) Once more 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:86:16)

  14) 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)

  15) test it again 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:111:45)

  16) and again 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:164:45)

  17) 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)

  18) boundary-joi-errors
       should return a 400 for Joi Validation errors:
     ReferenceError: Joi is not defined
      at Context.it (test/5errorFormat.test.js:184:21)

  19) boundary-joi-errors
       should return a 400 if any error is Joi:
     ReferenceError: Joi is not defined
      at Context.it (test/5errorFormat.test.js:194:13)

npm ERR! Test failed.  See above for more details.

Minor mods

$ cd /tmp
$ PROJECT_ROOT="issue-3893"
$ git clone https://github.com/nwesterman/mochaExitCode_3893.git ${PROJECT_ROOT}
$ cd ${PROJECT_ROOT}

Made minor modifications to repository structure to simplify testing.

$ mkdir test
$ mv *.js test/
$ touch index.js
$ cat << EOF >> "package.json"
{
  "name": "issue-3893",
  "version": "1.0.0",
  "description": "Code to reproduce https://github.com/mochajs/mocha/issues/3893",
  "main": "index.js",
  "scripts": {
    "list:deps": "npm list --depth=1",
    "pretest": "/bin/echo -n 'Mocha v' && mocha --version",
    "test": "mocha",
    "test:debug": "DEBUG=* mocha"
  },
  "directories": {
    "test": "test"
  },
  "devDependencies": {
    "camelcase": "^5.3.1",
    "chai": "^4.2.0",
    "decamelize": "^3.2.0",
    "joi": "^14.3.1",
    "mocha": "^6.1.4",
    "sinon": "^7.3.2",
    "xmllint": "^0.1.1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/nwesterman/mochaExitCode_3893.git"
  },
  "keywords": [
    "mocha"
  ],
  "author": "P. Roebuck <[email protected]>",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/nwesterman/mochaExitCode_3893/issues"
  },
  "homepage": "https://github.com/nwesterman/mochaExitCode_3893#readme"
}
EOF

Same results every run (WOMM)

$ npm test

> [email protected] pretest /tmp/issue-3893
> /bin/echo -n 'Mocha v' && mocha --version

Mocha v6.1.4

> [email protected] 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.
$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.