11'use strict' ;
2- var common = require ( '../common' ) ;
3- var assert = require ( 'assert' ) ;
2+ const common = require ( '../common' ) ;
3+ const assert = require ( 'assert' ) ;
44
55if ( ! common . hasCrypto ) {
66 common . skip ( 'missing crypto' ) ;
77 return ;
88}
99
10- var https = require ( 'https' ) ;
11- var crypto = require ( 'crypto' ) ;
10+ const https = require ( 'https' ) ;
11+ const crypto = require ( 'crypto' ) ;
1212
13- var fs = require ( 'fs' ) ;
13+ const fs = require ( 'fs' ) ;
1414
15- var options = {
15+ const options = {
1616 key : fs . readFileSync ( common . fixturesDir + '/keys/agent1-key.pem' ) ,
1717 cert : fs . readFileSync ( common . fixturesDir + '/keys/agent1-cert.pem' )
1818} ;
1919
20- var ca = fs . readFileSync ( common . fixturesDir + '/keys/ca1-cert.pem' ) ;
20+ const ca = fs . readFileSync ( common . fixturesDir + '/keys/ca1-cert.pem' ) ;
2121
22- var clientSessions = { } ;
23- var serverRequests = 0 ;
22+ const clientSessions = { } ;
23+ let serverRequests = 0 ;
2424
25- var agent = new https . Agent ( {
25+ const agent = new https . Agent ( {
2626 maxCachedSessions : 1
2727} ) ;
2828
29- var server = https . createServer ( options , function ( req , res ) {
29+ const server = https . createServer ( options , function ( req , res ) {
3030 if ( req . url === '/drop-key' )
3131 server . setTicketKeys ( crypto . randomBytes ( 48 ) ) ;
3232
3333 serverRequests ++ ;
3434 res . end ( 'ok' ) ;
3535} ) . listen ( 0 , function ( ) {
36- var queue = [
36+ const queue = [
3737 {
3838 name : 'first' ,
3939
@@ -97,7 +97,7 @@ var server = https.createServer(options, function(req, res) {
9797 ] ;
9898
9999 function request ( ) {
100- var options = queue . shift ( ) ;
100+ const options = queue . shift ( ) ;
101101 options . agent = agent ;
102102 https . request ( options , function ( res ) {
103103 clientSessions [ options . name ] = res . socket . getSession ( ) ;
@@ -114,9 +114,9 @@ var server = https.createServer(options, function(req, res) {
114114} ) ;
115115
116116process . on ( 'exit' , function ( ) {
117- assert . equal ( serverRequests , 6 ) ;
118- assert . equal ( clientSessions [ 'first' ] . toString ( 'hex' ) ,
119- clientSessions [ 'first-reuse' ] . toString ( 'hex' ) ) ;
117+ assert . strictEqual ( serverRequests , 6 ) ;
118+ assert . strictEqual ( clientSessions [ 'first' ] . toString ( 'hex' ) ,
119+ clientSessions [ 'first-reuse' ] . toString ( 'hex' ) ) ;
120120 assert . notEqual ( clientSessions [ 'first' ] . toString ( 'hex' ) ,
121121 clientSessions [ 'cipher-change' ] . toString ( 'hex' ) ) ;
122122 assert . notEqual ( clientSessions [ 'first' ] . toString ( 'hex' ) ,
@@ -125,6 +125,6 @@ process.on('exit', function() {
125125 clientSessions [ 'before-drop' ] . toString ( 'hex' ) ) ;
126126 assert . notEqual ( clientSessions [ 'before-drop' ] . toString ( 'hex' ) ,
127127 clientSessions [ 'after-drop' ] . toString ( 'hex' ) ) ;
128- assert . equal ( clientSessions [ 'after-drop' ] . toString ( 'hex' ) ,
129- clientSessions [ 'after-drop-reuse' ] . toString ( 'hex' ) ) ;
128+ assert . strictEqual ( clientSessions [ 'after-drop' ] . toString ( 'hex' ) ,
129+ clientSessions [ 'after-drop-reuse' ] . toString ( 'hex' ) ) ;
130130} ) ;
0 commit comments