Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps-dev): bump standard from 16.0.4 to 17.0.0 #448

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -123,12 +123,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 @@ -28,15 +28,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 @@ -32,10 +32,10 @@ function runTracker (opts, cb) {
...(opts.setupClient ? { setupClient: require(opts.setupClient) } : 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