Skip to content

Commit

Permalink
chore: add fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Aug 12, 2024
1 parent f8e8c8b commit 2cb5dd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
15 changes: 15 additions & 0 deletions test/fixtures/changelog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const changelog = `
- fix(A): a bug fix
- hotfix(A): a bug fix
- bug(A): a bug fix
- feat(B): a feature
- feature(B): a feature
- enhancement(B): a feature
- break(C): a major update
- breaking(C): a major update
- feat(D): a feature
- docs(): a doc change
- chore: a chore
- break(g): a minor fix
- break(H H): a major update
`
16 changes: 1 addition & 15 deletions test/renderer.test.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import { describe, expect, it } from 'vitest'
import { ChangelogReg } from '../src/renderer'
import { changelog } from './fixtures/changelog'

describe('renderer', () => {
it('changelogReg', () => {
const changelog = `
- fix(A): a bug fix
- hotfix(A): a bug fix
- bug(A): a bug fix
- feat(B): a feature
- feature(B): a feature
- enhancement(B): a feature
- break(C): a major update
- breaking(C): a major update
- feat(D): a feature
- docs(): a doc change
- chore: a chore
- break(g): a minor fix
- break(H H): a major update
`
const result = changelog.matchAll(ChangelogReg)
expect([...result]).toMatchSnapshot()
})
Expand Down

0 comments on commit 2cb5dd7

Please sign in to comment.