cmorten / superoak

HTTP assertions for Oak made easy via SuperDeno. 🐿 🦕
https://cmorten.github.io/superoak/
MIT License
121 stars 8 forks source link

I can`t install it #4

Closed michael-panda-li closed 4 years ago

michael-panda-li commented 4 years ago

Issue

Setup:

deno 1.0.5 v8 8.4.300 typescript 3.9.2

Details

What i did: copy paste your demo code on the github

The Error: error: error sending request for url (https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/Set.ts): error trying to connect: dns error: 请求的名称有效,但是找不到请求的类型的数据。 (os error 11004)

translation: title of the request is valid, but could not find the data of requesting type.(sorry for the bad translation)

asos-craigmorten commented 4 years ago

Hi @michael-panda-li 👋 thanks for raising this issue.

I had looked at the examples and they are wrong, many apologies!

This should be fixed in https://github.com/asos-craigmorten/superoak/pull/5.

If the updated examples are still no help, please could you add the code you are using?

If you did just copied and paste the examples, then the error you have looks like Deno had problems requesting a module from https://github.com/garronej/minimal_polyfills. Please confirm that you are able to access this URL and https://raw.githubusercontent.com/garronej/minimal_polyfills/2.1.0/Set.ts? It may be a DNS issue with the code being hosted on GitHub.

michael-panda-li commented 4 years ago

I'm in China, maybe it`s the DNS issue. I figured out a way to testing API for deno. https://github.com/michael-panda-li/DenoHttpTestingHack.

asos-craigmorten commented 4 years ago

I'm vaguely aware of some DNS issues with accessing the raw.githubusercontent.com domain from China which unfortunately might not make this a very accessible solution given it's current hosting and how Deno uses raw.githubusercontent.com for GitHub hosted Deno modules - unfortunately I can't reproduce, nor confirm if this is or isn't the case.

Your solution looks very reasonable, and is similar to how this library works. The main difference is that this library uses superagent to provide an abstraction over the fetch request and assertion methods to test said requests.

For simple servers / libraries, making the fetch requests / server wrappers yourself is perfectly fine, as you have done.

michael-panda-li commented 4 years ago

Thanks for the answer, it's really fun to work with new frameworks like deno, although there is lot's stuff missing.