mirror of
				https://github.com/public-transport/db-vendo-client.git
				synced 2025-11-04 10:06:32 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			454 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			454 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const testLines = async (cfg) => {
 | 
						|
	const {
 | 
						|
		test: t,
 | 
						|
		fetchLines,
 | 
						|
		validate,
 | 
						|
		query,
 | 
						|
	} = cfg;
 | 
						|
 | 
						|
	const res = await fetchLines(query);
 | 
						|
	const {
 | 
						|
		lines,
 | 
						|
		realtimeDataUpdatedAt,
 | 
						|
	} = res;
 | 
						|
 | 
						|
	for (let i = 0; i < res.lines.length; i++) {
 | 
						|
		const l = res.lines[i];
 | 
						|
		const name = `res.lines[${i}]`;
 | 
						|
		validate(t, l, 'line', name);
 | 
						|
	}
 | 
						|
 | 
						|
	validate(t, realtimeDataUpdatedAt, 'realtimeDataUpdatedAt', 'res.realtimeDataUpdatedAt');
 | 
						|
};
 | 
						|
 | 
						|
export {
 | 
						|
	testLines,
 | 
						|
};
 |