mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-01 03:16:56 -05:00
23e3821e24
This collapses the difference between master and single-process-server-tests, to remove some larger fixtures files that were in that feature branch.
29 lines
1.1 KiB
CoffeeScript
29 lines
1.1 KiB
CoffeeScript
request = require 'request'
|
|
require '../common'
|
|
config = require '../../../server_config'
|
|
nockUtils = require('../nock-utils')
|
|
|
|
xdescribe 'nock-utils', ->
|
|
afterEach nockUtils.teardownNock
|
|
|
|
describe 'a test using setupNock', ->
|
|
it 'records and plays back third-party requests, but not localhost requests', (done) ->
|
|
nockUtils.setupNock 'nock-test.json', (err, nockDone) ->
|
|
request.get { uri: getURL('/db/level') }, (err) ->
|
|
expect(err).toBeNull()
|
|
t0 = new Date().getTime()
|
|
request.get { uri: 'http://zombo.com/' }, (err) ->
|
|
console.log 'cached speed', new Date().getTime() - t0
|
|
expect(err).toBeNull()
|
|
nockDone()
|
|
done()
|
|
|
|
describe 'another, sibling test that does not use setupNock', ->
|
|
it 'is proceeds normally', (done) ->
|
|
request.get { uri: getURL('/db/level') }, (err) ->
|
|
expect(err).toBeNull()
|
|
t0 = new Date().getTime()
|
|
request.get { uri: 'http://zombo.com/' }, (err) ->
|
|
console.log 'uncached speed', new Date().getTime() - t0
|
|
expect(err).toBeNull()
|
|
done()
|