loopbackio / loopback-connector-rest

Connect Loopback to a REST API
http://loopback.io/doc/en/lb2/REST-connector.html
Other
75 stars 81 forks source link

[Fix] Updated index on template build and fixed test #142

Closed jeemok closed 4 years ago

jeemok commented 4 years ago

Description

Loopback-connector-rest should support object variables with expressions {var} when is not defined in template (as mentioned in the test). However, it was not working correctly.

Due to the test was written in the following way

assert.equal(bodyContent, result.body);

where build function will mutate the original values, hence, the test wasn't working correctly.

When added logging, you can see: image

Related issues

Checklist

slnode commented 4 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

dhmlau commented 4 years ago

@jeemok, thanks for your PR. Another thing to note is the commit linter error. Could you please fix it too?

**************************************************
**
**  Linting commit logs
**
**  2 problems found:
**    df85293 - Merge branch 'master' of https://github.com/jeemok/: First line should be 50 characters or less (saw 74)
**    a14be9a - [Fix] Updated index on template build and fixed tes: First line should be 50 characters or less (saw 52)
**
**************************************************

As a reference, here is our commit message guideline: https://loopback.io/doc/en/contrib/git-commit-messages.html, and the instruction in amend the commit message: https://help.github.com/en/articles/changing-a-commit-message.

jeemok commented 4 years ago

@dhmlau sorry about that, I have updated the commits.

dhmlau commented 4 years ago

@slnode test please

jeemok commented 4 years ago

Hi @dhmlau @raymondfeng, just to follow up on this. What's the plan for this PR?

Thanks, Mok

dhmlau commented 4 years ago

@raymondfeng, could you please review again? Thanks.