@@ -60,82 +60,82 @@ tape( 'main export is a function', function test( t ) {
6060 t . end ( ) ;
6161} ) ;
6262
63- tape ( 'validates valid_complete.md.txt with default schema' , function test ( t ) {
63+ tape ( 'the function validates a valid Markdown file containing all sections ( default schema) ' , function test ( t ) {
6464 lint ( FIXTURE_VALID_COMPLETE , { } , done ) ;
6565
6666 function done ( err , file ) {
6767 if ( err ) {
6868 t . fail ( err . message ) ;
6969 }
70- t . strictEqual ( file . messages . length , 0 , 'has no errors for valid fixture with all sections ' ) ;
70+ t . strictEqual ( file . messages . length , 0 , 'returns expected value ' ) ;
7171 t . end ( ) ;
7272 }
7373} ) ;
7474
75- tape ( 'validates valid_memoize.md.txt ' , function test ( t ) {
75+ tape ( 'the function validates a valid Markdown file which does not contain C sections (default schema) ' , function test ( t ) {
7676 lint ( FIXTURE_VALID_MEMOIZE , { } , done ) ;
7777
7878 function done ( err , file ) {
7979 if ( err ) {
8080 t . fail ( err . message ) ;
8181 }
82- t . strictEqual ( file . messages . length , 0 , 'has no errors for memoize README fixture ' ) ;
82+ t . strictEqual ( file . messages . length , 0 , 'returns expected value ' ) ;
8383 t . end ( ) ;
8484 }
8585} ) ;
8686
87- tape ( 'validates valid_asin.md.txt with C section ' , function test ( t ) {
87+ tape ( 'the function validates a valid Markdown file containing C sections (default schema) ' , function test ( t ) {
8888 lint ( FIXTURE_VALID_ASIN , { } , done ) ;
8989
9090 function done ( err , file ) {
9191 if ( err ) {
9292 t . fail ( err . message ) ;
9393 }
94- t . strictEqual ( file . messages . length , 0 , 'has no errors for asin README fixture with C section ' ) ;
94+ t . strictEqual ( file . messages . length , 0 , 'returns expected value ' ) ;
9595 t . end ( ) ;
9696 }
9797} ) ;
9898
99- tape ( 'detects missing C usage section in invalid_asin.md.txt ' , function test ( t ) {
99+ tape ( 'the function validates an invalid Markdown file missing a C section (default schema) ' , function test ( t ) {
100100 lint ( FIXTURE_INVALID_ASIN , { } , done ) ;
101101
102102 function done ( err , file ) {
103103 if ( err ) {
104104 t . fail ( err . message ) ;
105105 }
106- t . strictEqual ( file . messages . length , 1 , 'has one error for invalid asin fixture ' ) ;
107- t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'Missing required sections in "c" section: `usage`' ) , true , 'error identifies the missing C usage section ' ) ;
106+ t . strictEqual ( file . messages . length , 1 , 'returns expected value ' ) ;
107+ t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'Missing required sections in "c" section: `usage`' ) , true , 'returns expected value ' ) ;
108108 t . end ( ) ;
109109 }
110110} ) ;
111111
112- tape ( 'reports error for missing required root sections' , function test ( t ) {
112+ tape ( 'the function validates an invalid Markdown file missing required root sections (default schema) ' , function test ( t ) {
113113 lint ( FIXTURE_MISSING_ROOT , { } , done ) ;
114114
115115 function done ( err , file ) {
116116 if ( err ) {
117117 t . fail ( err . message ) ;
118118 }
119- t . strictEqual ( file . messages . length , 1 , 'has one error for fixture missing a required root section ' ) ;
120- t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'Missing required root-level sections: `usage`' ) , true , 'error identifies the missing section ' ) ;
119+ t . strictEqual ( file . messages . length , 1 , 'returns expected value ' ) ;
120+ t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'Missing required root-level sections: `usage`' ) , true , 'returns expected value ' ) ;
121121 t . end ( ) ;
122122 }
123123} ) ;
124124
125- tape ( 'reports error for incomplete C section' , function test ( t ) {
125+ tape ( 'the function validates an invalid Markdown file having an incomplete C section (default schema) ' , function test ( t ) {
126126 lint ( FIXTURE_INCOMPLETE_C , { } , done ) ;
127127
128128 function done ( err , file ) {
129129 if ( err ) {
130130 t . fail ( err . message ) ;
131131 }
132- t . strictEqual ( file . messages . length , 1 , 'has one error for fixture with an incomplete C section ' ) ;
133- t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'Missing required sections in "c" section: `usage`, `examples`' ) , true , 'error identifies the missing C sections ' ) ;
132+ t . strictEqual ( file . messages . length , 1 , 'returns expected value ' ) ;
133+ t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'Missing required sections in "c" section: `usage`, `examples`' ) , true , 'returns expected value ' ) ;
134134 t . end ( ) ;
135135 }
136136} ) ;
137137
138- tape ( 'validates valid_complete.md.txt with custom schema' , function test ( t ) {
138+ tape ( 'the function validates a valid Markdown file containing all sections using a custom schema' , function test ( t ) {
139139 lint ( FIXTURE_VALID_COMPLETE , {
140140 'schema' : CUSTOM_SCHEMA
141141 } , done ) ;
@@ -144,12 +144,12 @@ tape( 'validates valid_complete.md.txt with custom schema', function test( t ) {
144144 if ( err ) {
145145 t . fail ( err . message ) ;
146146 }
147- t . strictEqual ( file . messages . length , 0 , 'has no errors for valid fixture with custom schema ' ) ;
147+ t . strictEqual ( file . messages . length , 0 , 'returns expected value ' ) ;
148148 t . end ( ) ;
149149 }
150150} ) ;
151151
152- tape ( 'reports correct errors with custom schema' , function test ( t ) {
152+ tape ( 'the function validates an invalid Markdown file containing a missing root section using a custom schema' , function test ( t ) {
153153 var opts = {
154154 'schema' : CUSTOM_SCHEMA
155155 } ;
@@ -159,8 +159,8 @@ tape( 'reports correct errors with custom schema', function test( t ) {
159159 if ( err ) {
160160 t . fail ( err . message ) ;
161161 }
162- t . strictEqual ( file . messages . length , 1 , 'has correct number of errors with custom schema ' ) ;
163- t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'usage' ) && contains ( file . messages [ 0 ] . reason , 'related' ) , true , 'error identifies both missing sections ' ) ;
162+ t . strictEqual ( file . messages . length , 1 , 'returns expected value ' ) ;
163+ t . strictEqual ( contains ( file . messages [ 0 ] . reason , 'usage' ) && contains ( file . messages [ 0 ] . reason , 'related' ) , true , 'returns expected value ' ) ;
164164 t . end ( ) ;
165165 }
166166} ) ;
0 commit comments