File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1563,7 +1563,7 @@ describe('SessionEvictor', function() {
15631563 sessionEvictor . evict ( CONFIG , RESOURCE , AVAILABLE ) ;
15641564 } ) ;
15651565
1566- it ( 'should run a query & update evicted status on session' , function ( done ) {
1566+ it ( 'should set evicted to true when a session expires ' , function ( done ) {
15671567 sessionEvictor . evictor . evict = function ( ) {
15681568 return true ;
15691569 } ;
@@ -1580,6 +1580,23 @@ describe('SessionEvictor', function() {
15801580 sessionEvictor . evict ( CONFIG , RESOURCE , AVAILABLE ) ;
15811581 } ) ;
15821582
1583+ it ( 'should set evicted to false when sessions dont expire' , function ( done ) {
1584+ sessionEvictor . evictor . evict = function ( ) {
1585+ return true ;
1586+ } ;
1587+
1588+ RESOURCE . obj . keepAlive = function ( callback ) {
1589+ callback ( null ) ;
1590+
1591+ setImmediate ( function ( ) {
1592+ assert . strictEqual ( RESOURCE . obj . evicted_ , false ) ;
1593+ done ( ) ;
1594+ } ) ;
1595+ } ;
1596+
1597+ sessionEvictor . evict ( CONFIG , RESOURCE , AVAILABLE ) ;
1598+ } ) ;
1599+
15831600 it ( 'should return false if still active' , function ( ) {
15841601 var evictReturnValue = sessionEvictor . evict ( CONFIG , RESOURCE , AVAILABLE ) ;
15851602 assert . strictEqual ( evictReturnValue , false ) ;
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ describe('Session', function() {
232232 } ) ;
233233
234234 describe ( 'keepAlive' , function ( ) {
235- it ( 'should correctl call and return the gax API' , function ( ) {
235+ it ( 'should correctly call and return the gax API' , function ( ) {
236236 var gaxReturnValue = { } ;
237237
238238 function callback ( ) { }
You can’t perform that action at this time.
0 commit comments