{"size": 391, "ext": "js", "max_stars_repo_path": "ch12/02-stress.test.js", "max_stars_repo_name": "Hans-Tsai/nodejs-express-practice", "max_stars_repo_stars_event_min_datetime": "2020-12-07T03:37:18.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-07T03:37:18.000Z", "max_issues_repo_path": "ch18-19/ch12/02-stress.test.js", "max_issues_repo_name": "Hans-Tsai/nodejs-express-practice", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ch18-19/ch12/02-stress.test.js", "max_forks_repo_name": "Hans-Tsai/nodejs-express-practice", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.5789473684, "max_line_length": 66, "alphanum_fraction": 0.5959079284}
const loadtest = require('loadtest')

describe('stress tests', function(){

  test('homepage should handle 50 requests in a second', done => {
    const options = {
      url: 'http://localhost:3000',
      concurrency: 4,
      maxRequests: 50,
    }
    loadtest.loadTest(options, (err,result) => {
      expect(!err)
      expect(result.totalTimeSeconds < 1)
      done()
    })
  })

})
