You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					12 lines
				
				379 B
			
		
		
			
		
	
	
					12 lines
				
				379 B
			| 
								 
											3 years ago
										 
									 | 
							
								var jwt = require('../index');
							 | 
						||
| 
								 | 
							
								var expect = require('chai').expect;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								describe('noTimestamp', function() {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  it('should work with string', function () {
							 | 
						||
| 
								 | 
							
								    var token = jwt.sign({foo: 123}, '123', { expiresInMinutes: 5 , noTimestamp: true });
							 | 
						||
| 
								 | 
							
								    var result = jwt.verify(token, '123');
							 | 
						||
| 
								 | 
							
								    expect(result.exp).to.be.closeTo(Math.floor(Date.now() / 1000) + (5*60), 0.5);
							 | 
						||
| 
								 | 
							
								  });
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								});
							 |