mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	
		
			
	
	
		
			22 lines
		
	
	
		
			515 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
		
			515 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
|   | 'use strict'; | ||
|  | 
 | ||
|  | const response = require('../helpers/context').response; | ||
|  | 
 | ||
|  | describe('res.header', function () { | ||
|  |   it('should return the response header object', function () { | ||
|  |     const res = response(); | ||
|  |     res.set('X-Foo', 'bar'); | ||
|  |     res.header.should.eql({ | ||
|  |       'x-foo': 'bar' | ||
|  |     }); | ||
|  |   }); | ||
|  | 
 | ||
|  |   describe('when res._headers not present', function () { | ||
|  |     it('should return empty object', function () { | ||
|  |       const res = response(); | ||
|  |       res.res._headers = null; | ||
|  |       res.header.should.eql({}); | ||
|  |     }); | ||
|  |   }); | ||
|  | }); |