mirror of
				https://github.com/Mibew/simple-icons.git
				synced 2025-10-31 18:41:07 +03:00 
			
		
		
		
	* Remove `.get` from package's default export * Update TypeScript definitions * Updated index.js test suite
		
			
				
	
	
		
			24 lines
		
	
	
		
			706 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			706 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const { icons } = require('../_data/simple-icons.json');
 | |
| const simpleIcons = require('../index.js');
 | |
| const { getIconSlug } = require('../scripts/utils');
 | |
| 
 | |
| icons.forEach((icon) => {
 | |
|   const slug = getIconSlug(icon);
 | |
| 
 | |
|   test(`'Get' ${icon.title} by its slug`, () => {
 | |
|     const found = simpleIcons.Get(slug);
 | |
|     expect(found).toBeDefined();
 | |
|     expect(found.title).toEqual(icon.title);
 | |
|     expect(found.hex).toEqual(icon.hex);
 | |
|     expect(found.source).toEqual(icon.source);
 | |
|   });
 | |
| });
 | |
| 
 | |
| test(`Iterating over simpleIcons only exposes icons`, () => {
 | |
|   const iconArray = Object.values(simpleIcons);
 | |
|   for (let icon of iconArray) {
 | |
|     expect(icon).toBeDefined();
 | |
|     expect(typeof icon).toBe('object');
 | |
|   }
 | |
| });
 |