mirror of
https://github.com/primer/css.git
synced 2024-11-28 13:12:16 +03:00
add default stories.js to module template
This commit is contained in:
parent
3fbaa64dc8
commit
3ef9525d25
11
tools/generator-primer-module/app/templates/stories.js
Normal file
11
tools/generator-primer-module/app/templates/stories.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { storiesOf } from '@storybook/react'
|
||||||
|
import storiesFromMarkdown from '../../.storybook/lib/storiesFromMarkdown'
|
||||||
|
|
||||||
|
const stories = storiesOf('<%= title %>', module)
|
||||||
|
|
||||||
|
storiesFromMarkdown(require.context('.', true, /\.md$/))
|
||||||
|
.forEach(({title, story}) => {
|
||||||
|
stories.add(title, story)
|
||||||
|
})
|
||||||
|
|
@ -26,6 +26,9 @@ test("file scaffolding", t => {
|
|||||||
assert.fileContent(readme, `npmjs.org/package/${module}`)
|
assert.fileContent(readme, `npmjs.org/package/${module}`)
|
||||||
assert.fileContent(readme, `npm install --save ${module}`)
|
assert.fileContent(readme, `npm install --save ${module}`)
|
||||||
|
|
||||||
|
// default Storybook config
|
||||||
|
assert.fileContent(path("stories.js"), `storiesOf('Test'`)
|
||||||
|
|
||||||
assert.file(path("lib/test.scss"))
|
assert.file(path("lib/test.scss"))
|
||||||
|
|
||||||
t.pass("All the files exist.")
|
t.pass("All the files exist.")
|
||||||
|
Loading…
Reference in New Issue
Block a user