File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 24
24
"disparity" : " ^2.0.0" ,
25
25
"doctrine" : " ^1.1.0" ,
26
26
"documentation-theme-utils" : " ^3.0.0" ,
27
- "lodash" : " ^4.11.1" ,
28
27
"events" : " ^1.1.0" ,
29
28
"extend" : " ^3.0.0" ,
30
29
"get-comments" : " ^1.0.1" ,
31
30
"git-url-parse" : " ^6.0.1" ,
32
31
"highlight.js" : " ^9.1.0" ,
33
32
"js-yaml" : " ^3.3.1" ,
33
+ "lodash" : " ^4.11.1" ,
34
34
"mdast-util-inject" : " ^1.1.0" ,
35
35
"micromatch" : " ^2.1.6" ,
36
36
"mime" : " ^1.3.4" ,
58
58
"chdir" : " 0.0.0" ,
59
59
"eslint" : " ^2.0.0" ,
60
60
"fs-extra" : " ^0.30.0" ,
61
+ "documentation-schema" : " 0.0.1" ,
61
62
"glob" : " ^7.0.0" ,
63
+ "json-schema" : " 0.2.2" ,
62
64
"mock-fs" : " ^3.5.0" ,
63
65
"tap" : " ^5.4.4" ,
64
66
"tmp" : " 0.0.28"
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
var test = require ( 'tap' ) . test ,
4
+ documentationSchema = require ( 'documentation-schema' ) ,
5
+ validate = require ( 'json-schema' ) ,
4
6
documentation = require ( '../' ) ,
5
7
outputMarkdown = require ( '../lib/output/markdown.js' ) ,
6
8
outputMarkdownAST = require ( '../lib/output/markdown_ast.js' ) ,
@@ -147,6 +149,11 @@ test('outputs', function (ttt) {
147
149
148
150
tt . test ( 'JSON' , function ( t ) {
149
151
normalize ( result ) ;
152
+ result . forEach ( function ( comment ) {
153
+ validate ( comment , documentationSchema . jsonSchema ) . errors . forEach ( function ( error ) {
154
+ t . ifError ( error ) ;
155
+ } ) ;
156
+ } ) ;
150
157
var outputfile = file . replace ( '.input.js' , '.output.json' ) ;
151
158
if ( UPDATE ) {
152
159
fs . writeFileSync ( outputfile , JSON . stringify ( result , null , 2 ) ) ;
You can’t perform that action at this time.
0 commit comments