diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/test/retries.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-client/test/retries.js | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/test/retries.js b/deps/npm/node_modules/npm-registry-client/test/retries.js index 0f0fa36673c..3101a5d5760 100644 --- a/deps/npm/node_modules/npm-registry-client/test/retries.js +++ b/deps/npm/node_modules/npm-registry-client/test/retries.js @@ -1,49 +1,49 @@ -var tap = require("tap") +var tap = require('tap') -var server = require("./lib/server.js") -var common = require("./lib/common.js") +var server = require('./lib/server.js') +var common = require('./lib/common.js') var client = common.freshClient({ - retry : { - retries : 6, - minTimeout : 10, - maxTimeout : 100 + retry: { + retries: 6, + minTimeout: 10, + maxTimeout: 100 } }) var pkg = { - _id : "some-package@1.2.3", - name : "some-package", - version : "1.2.3" + _id: 'some-package@1.2.3', + name: 'some-package', + version: '1.2.3' } -tap.test("create new user account", function (t) { +tap.test('create new user account', function (t) { // first time, return a 408 - server.expect("GET", "/some-package/1.2.3", function (req, res) { + server.expect('GET', '/some-package/1.2.3', function (req, res) { res.statusCode = 408 - res.end("Timeout") + res.end('Timeout') }) // then, slam the door in their face - server.expect("GET", "/some-package/1.2.3", function (req, res) { + server.expect('GET', '/some-package/1.2.3', function (req, res) { res.destroy() }) // then, blame someone else - server.expect("GET", "/some-package/1.2.3", function (req, res) { + server.expect('GET', '/some-package/1.2.3', function (req, res) { res.statusCode = 502 - res.end("Gateway Timeout") + res.end('Gateway Timeout') }) // 'No one's home right now, come back later' - server.expect("GET", "/some-package/1.2.3", function (req, res) { + server.expect('GET', '/some-package/1.2.3', function (req, res) { res.statusCode = 503 - res.setHeader("retry-after", "10") - res.end("Come back later") + res.setHeader('retry-after', '10') + res.end('Come back later') }) // finally, you may enter. - server.expect("GET", "/some-package/1.2.3", function (req, res) { + server.expect('GET', '/some-package/1.2.3', function (req, res) { res.statusCode = 200 res.json(pkg) }) - client.get("http://localhost:1337/some-package/1.2.3", {}, function (er, data) { + client.get('http://localhost:1337/some-package/1.2.3', {}, function (er, data) { if (er) throw er t.deepEqual(data, pkg) t.end() |