Skip to content

Commit 7c5c910

Browse files
committed
Merge branch 'reedsy-infer-component-name'
2 parents 4c55bca + 4295ef4 commit 7c5c910

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function ComponentOption(cons: Cons, extend?: any) {
3333
optionAccessor(cons, optionBuilder)
3434
optionMethodsAndHooks(cons, optionBuilder)//the last one
3535
const raw = {
36+
name: cons.name,
3637
setup: optionBuilder.setup,
3738
data() {
3839
delete optionBuilder.data

test/component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ describe('Component',
6969
expect(true).to.equal(isEmptyObject(EmptyContext[key]()))
7070
} else if (key === '__vfdConstructor') {
7171
expect('function').to.equal(typeof EmptyContext[key])
72+
} else if (key === 'name') {
73+
expect(EmptyContext[key]).to.equal('Empty')
7274
} else {
7375

7476
expect(true).to.equal(isEmptyObject(EmptyContext[key]))
@@ -105,4 +107,4 @@ describe('Component',
105107
})
106108
}
107109
)
108-
export default {}
110+
export default {}

0 commit comments

Comments
 (0)