File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -241,3 +241,28 @@ test('Vue file', async function() {
241
241
normalize ( data ) ;
242
242
expect ( data ) . toMatchSnapshot ( ) ;
243
243
} ) ;
244
+
245
+ test ( 'Use Source attribute only' , async function ( ) {
246
+ await pify ( chdir ) ( __dirname ) ;
247
+ const documentationSource = `
248
+ /**
249
+ * This Vue Component is a test
250
+ * @returns {vue-tested} vue-tested component
251
+ */
252
+ export default {
253
+
254
+ props: {
255
+
256
+ /**
257
+ * This is a number
258
+ */
259
+ myNumber: {
260
+ default: 42,
261
+ type: Number
262
+ }
263
+ }
264
+ }` ;
265
+ const data = await documentation . build ( [ { source : documentationSource } ] , { } ) ;
266
+ normalize ( data ) ;
267
+ expect ( data ) . toMatchSnapshot ( ) ;
268
+ } ) ;
Original file line number Diff line number Diff line change @@ -105,7 +105,10 @@ function buildInternal(inputsAndConfig) {
105
105
sourceFile . source = fs . readFileSync ( sourceFile . file , 'utf8' ) ;
106
106
}
107
107
108
- if ( path . extname ( sourceFile . file ) === '.vue' ) {
108
+ if (
109
+ typeof sourceFile . file === 'string' &&
110
+ path . extname ( sourceFile . file ) === '.vue'
111
+ ) {
109
112
return parseVueScript ( sourceFile , config ) . map ( buildPipeline ) ;
110
113
}
111
114
return parseJavaScript ( sourceFile , config ) . map ( buildPipeline ) ;
You can’t perform that action at this time.
0 commit comments