Skip to content

Commit

Permalink
Improve running tests in parallel.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Mar 25, 2018
1 parent 08e486a commit 8b6df9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions __tests__/testIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ 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((
<MuiThemeProvider>
<Icon />
</MuiThemeProvider>
)).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((
<MuiThemeProvider>
<Icon />
</MuiThemeProvider>
)).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)))
Expand Down
4 changes: 2 additions & 2 deletions generate-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down

0 comments on commit 8b6df9e

Please sign in to comment.