1
1
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:
Shawn Allen 2018-10-18 12:54:07 -07:00
parent 3fbaa64dc8
commit 3ef9525d25
2 changed files with 14 additions and 0 deletions

View 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)
})

View File

@ -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.")