Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Nov 1, 2024
1 parent 005290b commit 2fff6b9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion tests/integrations/flat-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ describe('Integration with flat config', () => {
}

const result = JSON.parse(
cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 1 --format=json`, {
cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 2 --format=json`, {
encoding: 'utf-8',
})
)
expect(result.length).toBe(1)
expect(result[0].messages[0].messageId).toBe('shouldHaveStoryExport')
expect(result[0].messages[1].messageId).toBe('metaShouldHaveInlineProperties')
})
})
6 changes: 2 additions & 4 deletions tests/integrations/flat-config/a.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const Input = () => 'This is an input component'

export default {
title: 'Input',
component: Input,
}
const title = 'foo';
export default { title }
1 change: 1 addition & 0 deletions tests/integrations/flat-config/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default [
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'storybook/story-exports': 'warn',
'storybook/meta-inline-properties': 'warn',
},
},
]
3 changes: 2 additions & 1 deletion tests/integrations/legacy-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ describe('Integration with legacy config', () => {
}

const result = JSON.parse(
cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 1 --format=json`, {
cp.execSync(`${ESLINT} a.stories.tsx --max-warnings 2 --format=json`, {
encoding: 'utf-8',
})
)
expect(result.length).toBe(1)
expect(result[0].messages[0].messageId).toBe('shouldHaveStoryExport')
expect(result[0].messages[1].messageId).toBe('metaShouldHaveInlineProperties')
})
})
3 changes: 2 additions & 1 deletion tests/integrations/legacy-config/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"files": ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],
"rules": {
"storybook/story-exports": "warn"
"storybook/story-exports": "warn",
"storybook/meta-inline-properties": "warn"
}
}
]
Expand Down
6 changes: 2 additions & 4 deletions tests/integrations/legacy-config/a.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const Input = () => 'This is an input component'

export default {
title: 'Input',
component: Input,
}
const title = 'foo';
export default { title }

0 comments on commit 2fff6b9

Please sign in to comment.