Thanks to visit codestin.com
Credit goes to github.com

Skip to content

column property from error messages is non-enumerable in 4.0.6 with noEscape: true (breaking regression) #1284

@nathanboktae

Description

@nathanboktae

We had a test that tried to compile this simple template and verify the error result:

SELECT sum(gold_balance) FROM {{#if}}_p_user__gold_balance{{/foo}}
{
  "column": 33,
  "lineNumber": 1,
  "message": "if doesn't match foo - 1:33",
  "name": "Error"
}

but it started failing on 4.0.6. Rolling back to 4.0.5 solves it.

~/work/api-server 23bc2a8|merge-dashboard-queries  ✹
 9:12AM 1 ᐅ npm install
[email protected] /Users/nblack/work/api-server
└─┬ [email protected]
  └── [email protected]

~/work/api-server 23bc2a8|merge-dashboard-queries  ✹
 9:13AM ᐅ TZ=Etc/UTC mocha -g "templated query fails"

  Queries
    Dashboard Queries
      1) should return 400 if the templated query fails to compile


  0 passing (254ms)
  1 failing

  1) Queries Dashboard Queries should return 400 if the templated query fails to compile:

      Error: expected { errors:
   { query:
      { column: 33,
        lineNumber: 1,
        message: 'if doesn\'t match foo - 1:33',
        name: 'Error' } } } response body, got { errors:
   { query:
      { lineNumber: 1,
        message: 'if doesn\'t match foo - 1:33',
        name: 'Error' } } }
      + expected - actual

       {
         "errors": {
           "query": {
      +      "column": 33
             "lineNumber": 1
             "message": "if doesn't match foo - 1:33"
             "name": "Error"
           }

      at endReadableNT (_stream_readable.js:926:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickDomainCallback (internal/process/next_tick.js:122:9)




~/work/api-server 23bc2a8|merge-dashboard-queries  ✹
 9:13AM 1 ᐅ npm install
[email protected] /Users/nblack/work/api-server
└── [email protected]

~/work/api-server 23bc2a8|merge-dashboard-queries  ✹
 9:14AM ᐅ TZ=Etc/UTC mocha -g "templated query fails"

  Queries
    Dashboard Queries
      ✓ should return 400 if the templated query fails to compile


  1 passing (212ms)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions