Skip to content

Commit

Permalink
fix(core): Add more tests to the previous commit
Browse files Browse the repository at this point in the history
Add more tests
  • Loading branch information
jamesnakagawa committed Dec 17, 2024
1 parent 5cbc923 commit 5d65b1e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/runtime-core/__tests__/componentProps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,17 +389,24 @@ describe('component props', () => {
bool: { type: Boolean, required: true },
str: { type: String, required: true },
num: { type: Number, required: true },
null: { type: null, required: true },
null1: { type: null, required: true },
null2: { type: null, required: true },
null3: { type: null, required: true },
},
setup() {
return () => null
},
}
render(h(Comp), nodeOps.createElement('div'))
render(
h(Comp, { null2: null, null3: undefined }),
nodeOps.createElement('div'),
)
expect(`Missing required prop: "bool"`).toHaveBeenWarned()
expect(`Missing required prop: "str"`).toHaveBeenWarned()
expect(`Missing required prop: "num"`).toHaveBeenWarned()
expect(`Missing required prop: "null"`).toHaveBeenWarned()
expect(`Missing required prop: "null1"`).toHaveBeenWarned()
expect(`Missing required prop: "null2"`).toHaveBeenWarned()
expect(`Missing required prop: "null3"`).toHaveBeenWarned()
})

test('warn on type mismatch', () => {
Expand Down

0 comments on commit 5d65b1e

Please sign in to comment.