Skip to content
This repository was archived by the owner on Mar 8, 2019. It is now read-only.

Commit 92dc984

Browse files
committed
Fix async error
1 parent 90dc971 commit 92dc984

File tree

4 files changed

+43
-29
lines changed

4 files changed

+43
-29
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-docgen-api",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "Toolbox to extract information from Vue component files for documentation generation purposes.",
55
"bugs": {
66
"url": "https://github.com/vue-styleguidist/vue-docgen-api/issues"

tests/components/vuex/example.vue

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
<template>
22
</template>
33
<script>
4-
import {mapGetters} from 'vuex'
5-
/**
6-
* Partial mapping, object spread operator example
7-
*/
8-
export default {
9-
name: 'example',
10-
computed: {
11-
total () {
12-
return this.$store.getters.allCustomers.length
13-
},
14-
...mapGetters({
15-
duplicate: 'hasDuplicateCustomer',
16-
characters: 'alphaKeys'
17-
})
18-
},
19-
methods: {
20-
async onSubmit () {
21-
let res = await api.post(this.params)
22-
this.response = response
23-
}
24-
},
25-
mounted () {
26-
console.log('Second component loaded')
27-
}
28-
}
4+
import {mapGetters} from 'vuex'
5+
/**
6+
* Partial mapping, object spread operator example
7+
*/
8+
export default {
9+
name: 'example',
10+
computed: {
11+
total () {
12+
return this.$store.getters.allCustomers.length
13+
},
14+
...mapGetters({
15+
duplicate: 'hasDuplicateCustomer',
16+
characters: 'alphaKeys'
17+
})
18+
},
19+
methods: {
20+
/**
21+
* Sets the order
22+
*
23+
* @public
24+
* @version 1.0.5
25+
* @since Version 1.0.1
26+
* @param {string} key Key to order
27+
* @returns {string} Test
28+
*/
29+
async onSubmit () {
30+
let res = await api.post(this.params)
31+
this.response = response
32+
}
33+
},
34+
mounted () {
35+
console.log('Second component loaded')
36+
}
37+
}
2938
</script>

tests/parse.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ describe('tests grid', () => {
5757

5858
describe('tests button', () => {
5959
docButton = api.parse(button);
60-
console.log(JSON.stringify(docButton, null, 2));
6160

6261
it('should return an object', () => {
6362
expect(docButton).to.be.an('object')
@@ -118,7 +117,6 @@ describe('tests button', () => {
118117

119118
describe('test example vuex', () =>{
120119
const docVuex = api.parse(exampleVuex);
121-
console.log(docVuex);
122120

123121
it('should return an object', () => {
124122
expect(docVuex).to.be.an('object')
@@ -131,4 +129,12 @@ describe('test example vuex', () =>{
131129
it('The component should have a description', () => {
132130
expect(docVuex.description).to.equal('Partial mapping, object spread operator example');
133131
})
132+
133+
it('should have a method', () => {
134+
expect(docVuex['methods'].length).to.equal(1)
135+
})
136+
137+
it('should have "submit" method', () => {
138+
expect(docVuex['methods'][0]['name']).to.equal('onSubmit')
139+
})
134140
})

tests/parseWebpack.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ describe('tests parseWebpack grid', () => {
6060

6161
describe('tests parseWebpack button', () => {
6262
docButton = api.parseWebpack(button);
63-
console.log(JSON.stringify(docButton, null, 2));
6463

6564
it('should return an object', () => {
6665
expect(docButton).to.be.an('object')

0 commit comments

Comments
 (0)