diff --git a/__tests__/testIcons.js b/__tests__/testIcons.js index 0251265..59c551e 100644 --- a/__tests__/testIcons.js +++ b/__tests__/testIcons.js @@ -6,8 +6,8 @@ import * as commonjsIcons from '../package/index' import * as es2015Icons from '../package/index.es' describe('the generated commonjs module', () => { - it('should export icons that render to SVGs', () => { - for (const iconName of Object.keys(commonjsIcons)) { + for (const iconName of Object.keys(commonjsIcons)) { + it(`should export a ${iconName} element that returns an SVG`, () => { const Icon = commonjsIcons[iconName] const renderedIcon = renderer.create(( @@ -15,13 +15,13 @@ describe('the generated commonjs module', () => { )).toJSON() expect(renderedIcon.type).toBe('svg') - } - }) + }) + } }) describe('the generated es2015 module', () => { - it('should export icons that render to SVGs', () => { - for (const iconName of Object.keys(es2015Icons)) { + for (const iconName of Object.keys(es2015Icons)) { + it(`should export a ${iconName} element that returns an SVG`, () => { const Icon = es2015Icons[iconName] const renderedIcon = renderer.create(( @@ -29,8 +29,8 @@ describe('the generated es2015 module', () => { )).toJSON() expect(renderedIcon.type).toBe('svg') - } - }) + }) + } it('should include the same icons as the CommonJS module', () => { expect(Object.keys(es2015Icons)).toEqual(expect.arrayContaining(Object.keys(commonjsIcons))) diff --git a/generate-module.js b/generate-module.js index de581d9..f34833d 100755 --- a/generate-module.js +++ b/generate-module.js @@ -46,8 +46,8 @@ const icons = require('@mdi/svg/meta.json') transformForReact(child) return child.toString().trim() }).join('').trim() - .replace(/xlink:href/ig, 'xlinkHref') - .replace() + .replace(/xlink:href/ig, 'xlinkHref') + .replace() if (svg.length === 0) { throw Error(`Unexpected number of paths (${xml.svg.path.length}) for ${icon.name}`)