Skip to content

Commit

Permalink
build(deps-dev): bump standard from 16.0.4 to 17.0.0 (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored May 4, 2022
1 parent 8d5aa97 commit c2c7083
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion autocannon.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function start (argv) {
const url = new URL(argv.url, `http://localhost:${port}`).href
const opts = Object.assign({}, argv, {
onPort: false,
url: url
url
})
const tracker = initJob(opts, () => {
proc.kill('SIGINT')
Expand Down
2 changes: 1 addition & 1 deletion lib/parseHAR.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

// given we support node v8
// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
const { parse } = require('url')

function parseHAR (har) {
Expand Down
10 changes: 5 additions & 5 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function run (opts, tracker, cb) {

const urls = ofURL(opts.url, true).map(url => {
if (url.indexOf('http') !== 0) url = 'http://' + url
url = URL.parse(url) // eslint-disable-line node/no-deprecated-api
url = URL.parse(url) // eslint-disable-line n/no-deprecated-api

// copy over fields so that the client
// performs the right HTTP requests
Expand Down Expand Up @@ -124,12 +124,12 @@ function run (opts, tracker, cb) {
totalRequests,
totalBytes,
samples,
errors: errors,
timeouts: timeouts,
mismatches: mismatches,
errors,
timeouts,
mismatches,
non2xx: statusCodes[0] + statusCodes[2] + statusCodes[3] + statusCodes[4],
statusCodeStats,
resets: resets,
resets,
duration: Math.round((Date.now() - startTime) / 10) / 100,
start: new Date(startTime),
finish: new Date()
Expand Down
18 changes: 9 additions & 9 deletions lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ function defaultOpts (opts) {

const requests = opts.requests
? opts.requests.map((r) => {
const setupRequest = opts.workers ? r.setupRequest : safeRequire(r.setupRequest)
const onResponse = opts.workers ? r.onResponse : safeRequire(r.onResponse)

return {
...r,
...(setupRequest ? { setupRequest } : undefined),
...(onResponse ? { onResponse } : undefined)
}
})
const setupRequest = opts.workers ? r.setupRequest : safeRequire(r.setupRequest)
const onResponse = opts.workers ? r.onResponse : safeRequire(r.onResponse)

return {
...r,
...(setupRequest ? { setupRequest } : undefined),
...(onResponse ? { onResponse } : undefined)
}
})
: undefined

return {
Expand Down
8 changes: 4 additions & 4 deletions lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ function runTracker (opts, cb) {
...(opts.verifyBody ? { verifyBody: require(opts.verifyBody) } : undefined),
requests: opts.requests
? opts.requests.map(r => ({
...r,
...(r.setupRequest ? { setupRequest: require(r.setupRequest) } : undefined),
...(r.onResponse ? { onResponse: require(r.onResponse) } : undefined)
}))
...r,
...(r.setupRequest ? { setupRequest: require(r.setupRequest) } : undefined),
...(r.onResponse ? { onResponse: require(r.onResponse) } : undefined)
}))
: undefined,
histograms: {
requests: createHist('requests'),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"proxyquire": "^2.1.3",
"sinon": "^13.0.0",
"split2": "^4.0.0",
"standard": "^16.0.3",
"standard": "^17.0.0",
"tap": "^16.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion samples/bench-multi-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function startBench () {
// same with run the follow command in cli
// autocannon -d 10 -c 2 http://localhost:xxxx http://localhost:yyyy
autocannon({
url: url,
url,
// connection number should n times of the number of server
connections: 2,
duration: 10,
Expand Down
4 changes: 2 additions & 2 deletions samples/customise-individual-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

autocannon({
url: url,
url,
connections: 1000,
duration: 10,
setupClient: setupClient
setupClient
}, finishedBench)

let connection = 0
Expand Down
2 changes: 1 addition & 1 deletion samples/init-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

autocannon({
url: url,
url,
connections: 1,
amount: 1,
initialContext: { user: { firstName: 'Salman' } },
Expand Down
2 changes: 1 addition & 1 deletion samples/modifying-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

const instance = autocannon({
url: url,
url,
connections: 1000,
duration: 10
}, finishedBench)
Expand Down
2 changes: 1 addition & 1 deletion samples/request-context-workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

autocannon({
url: url,
url,
duration: 2,
workers: 2,
requests: [
Expand Down
2 changes: 1 addition & 1 deletion samples/request-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

autocannon({
url: url,
url,
requests: [
{
// let's create a new user
Expand Down
2 changes: 1 addition & 1 deletion samples/requests-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

autocannon({
url: url,
url,
connections: 1000,
duration: 10,
headers: {
Expand Down
2 changes: 1 addition & 1 deletion samples/using-id-replacement.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function startBench () {
const url = 'http://localhost:' + server.address().port

autocannon({
url: url,
url,
connections: 1000,
duration: 10,
requests: [
Expand Down
2 changes: 1 addition & 1 deletion test/httpRequestBuilder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test('request builder should accept all valid standard http methods', (t) => {

const build = RequestBuilder(opts)

t.doesNotThrow(() => build({ method: method }), `${method} should be usable by the request builded`)
t.doesNotThrow(() => build({ method }), `${method} should be usable by the request builded`)
})
t.end()
})
Expand Down

0 comments on commit c2c7083

Please sign in to comment.