We have some internal proxies for all of the Jasmine functions, as well as some other helpers. This code hasn't been touched in more than 5 years, it can lead to confusion and it isn't really necessary since the same can be achieved using Jasmine. These changes remove most of the code and clean up our existing unit tests. PR Close #42177
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /**
 | |
|  * @license
 | |
|  * Copyright Google LLC All Rights Reserved.
 | |
|  *
 | |
|  * Use of this source code is governed by an MIT-style license that can be
 | |
|  * found in the LICENSE file at https://angular.io/license
 | |
|  */
 | |
| 
 | |
| 
 | |
| 
 | |
| /**
 | |
|  * @license
 | |
|  * Copyright Google LLC All Rights Reserved.
 | |
|  *
 | |
|  * Use of this source code is governed by an MIT-style license that can be
 | |
|  * found in the LICENSE file at https://angular.io/license
 | |
|  */
 | |
| 
 | |
| import {parseCookieValue} from '@angular/common/src/cookie';
 | |
| 
 | |
| {
 | |
|   describe('cookies', () => {
 | |
|     it('parses cookies', () => {
 | |
|       const cookie = 'other-cookie=false; xsrf-token=token-value; is_awesome=true; ffo=true;';
 | |
|       expect(parseCookieValue(cookie, 'xsrf-token')).toBe('token-value');
 | |
|     });
 | |
|     it('handles encoded keys', () => {
 | |
|       expect(parseCookieValue('whitespace%20token=token-value', 'whitespace token'))
 | |
|           .toBe('token-value');
 | |
|     });
 | |
|     it('handles encoded values', () => {
 | |
|       expect(parseCookieValue('token=whitespace%20', 'token')).toBe('whitespace ');
 | |
|       expect(parseCookieValue('token=whitespace%0A', 'token')).toBe('whitespace\n');
 | |
|     });
 | |
|   });
 | |
| }
 |