Skip to content

Commit bd88921

Browse files
committed
Improve tests
1 parent 2e12e20 commit bd88921

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/lib/utils/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ describe('getComponentProps', () => {
256256
return utils.getComponentProps(data)
257257
}
258258

259-
it('should return empty array when there is no props property', () => {
259+
it('should return empty array when there is no component props', () => {
260260
props = parse(`const test = {
261261
name: 'test',
262262
data() {
@@ -267,7 +267,7 @@ describe('getComponentProps', () => {
267267
assert.equal(props.length, 0)
268268
})
269269

270-
it('should return empty array when props property is empty array', () => {
270+
it('should return empty array when component props is empty array', () => {
271271
props = parse(`const test = {
272272
name: 'test',
273273
props: []
@@ -276,7 +276,7 @@ describe('getComponentProps', () => {
276276
assert.equal(props.length, 0)
277277
})
278278

279-
it('should return empty array when props property is empty object array', () => {
279+
it('should return empty array when component props is empty object', () => {
280280
props = parse(`const test = {
281281
name: 'test',
282282
props: {}
@@ -288,6 +288,7 @@ describe('getComponentProps', () => {
288288
it('should return computed props', () => {
289289
props = parse(`const test = {
290290
name: 'test',
291+
...test,
291292
data() {
292293
return {}
293294
},
@@ -314,7 +315,7 @@ describe('getComponentProps', () => {
314315
assert.ok(props[2].node.type === 'Property')
315316
assert.ok(props[2].value.type === 'ArrayExpression')
316317

317-
assert.ok(props[3].key.type === props[3].value.type)
318+
assert.deepEqual(props[3].key, props[3].value)
318319
assert.ok(props[3].node.type === 'Property')
319320
assert.ok(props[3].value.type === 'Identifier')
320321
})

0 commit comments

Comments
 (0)