scoreboard icon indicating copy to clipboard operation
scoreboard copied to clipboard

unit tests should not hit OSM / Maproulette APIs

Open guidorice opened this issue 4 years ago • 0 comments

I noticed this when running yarn test locally. I believe best practice is that 3rd party and external apis should be mocked. CI running unit tests can fail because of network problems (making it a flaky test), but it also it adds load to what is basically a free service which OSM is sponsoring.

  error: Error: connect ETIMEDOUT 198.199.72.41:443
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1134:16) {
    errno: 'ETIMEDOUT',
    code: 'ETIMEDOUT',
    syscall: 'connect',
    address: '198.199.72.41',
    port: 443
  },
  options: {
    uri: 'http://maproulette.org/api/v2/data/challenge/338',
    headers: { 'Accept-Language': 'en-US,en;q=0.9' },
    callback: [Function: RP$callback],
    transform: undefined,
    simple: true,
    resolveWithFullResponse: false,
    transform2xxOnly: false
  },

guidorice avatar Oct 20 '20 16:10 guidorice