-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an es2015 module. Don't append Icon to the icons. Enable importin…
…g single icons. Add tests.
- Loading branch information
Showing
8 changed files
with
5,218 additions
and
5,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
node_modules | ||
icons | ||
lib | ||
node_modules/ | ||
package/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* eslint-env jest */ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' | ||
import * as commonjsIcons from '../package/index' | ||
import * as es2015Icons from '../package/index.es' | ||
|
||
console.log('hi') | ||
|
||
describe('the generated commonjs module', () => { | ||
it('should export icons that render to SVGs', () => { | ||
for (const iconName of Object.keys(commonjsIcons)) { | ||
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)) { | ||
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))) | ||
expect(Object.keys(es2015Icons).length).toBe(Object.keys(commonjsIcons).length) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.