Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(http-server): remove "request" module from tests #2673

Merged
merged 1 commit into from
Apr 4, 2019

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Apr 2, 2019

See #2672.

This pull request is removing request from dev-dependencies of @loopback/http-server. The only test using that module is reworked to use httpGetAsync from Node.js core instead.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@bajtos bajtos added refactor REST Issues related to @loopback/rest package and REST transport in general labels Apr 2, 2019
@bajtos bajtos self-assigned this Apr 2, 2019
uri: server.url,
}),
).to.be.rejectedWith(/ECONNREFUSED/);
await expect(httpGetAsync(server.url)).to.be.rejectedWith(/ECONNREFUSED/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does supertest hide ECONNREFUSED too?

Copy link
Member Author

@bajtos bajtos Apr 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know 🤷‍♂️ . httpGetAsync is using Node.js core API, it's the simplest possible solution. That's why I prefer it over supertest or request.

@bajtos bajtos force-pushed the refactor/http-server-tests branch from c267a46 to 2a86c2b Compare April 4, 2019 05:54
@bajtos bajtos merged commit aee539c into master Apr 4, 2019
@bajtos bajtos deleted the refactor/http-server-tests branch April 4, 2019 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor REST Issues related to @loopback/rest package and REST transport in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants