@@ -23,6 +23,10 @@ const check = ({
23
23
text,
24
24
} ) => {
25
25
const plugin = getJsdocProcessorPlugin ( options ) ;
26
+ if ( ! plugin . processors || typeof plugin . processors . examples . preprocess !== 'function' ) {
27
+ throw new Error ( 'No processors' ) ;
28
+ }
29
+
26
30
const results = plugin . processors . examples . preprocess (
27
31
text , filename ,
28
32
) ;
@@ -168,6 +172,10 @@ describe('`getJsdocProcessorPlugin`', () => {
168
172
` ;
169
173
170
174
const plugin = getJsdocProcessorPlugin ( options ) ;
175
+ if ( ! plugin . processors || typeof plugin . processors . examples . preprocess !== 'function' ) {
176
+ throw new Error ( 'No processors' ) ;
177
+ }
178
+
171
179
const results = plugin . processors . examples . preprocess (
172
180
text , filename ,
173
181
) ;
@@ -179,6 +187,10 @@ describe('`getJsdocProcessorPlugin`', () => {
179
187
} ,
180
188
] ) ;
181
189
190
+ if ( ! plugin . processors || typeof plugin . processors . examples . postprocess !== 'function' ) {
191
+ throw new Error ( 'No processors' ) ;
192
+ }
193
+
182
194
const postResults = plugin . processors . examples . postprocess (
183
195
[
184
196
[ ] ,
@@ -380,7 +392,6 @@ describe('`getJsdocProcessorPlugin`', () => {
380
392
` ;
381
393
check ( {
382
394
filename,
383
- // @ts -expect-error Ok?
384
395
options,
385
396
result : [
386
397
text ,
@@ -651,6 +662,10 @@ describe('`getJsdocProcessorPlugin`', () => {
651
662
` ;
652
663
653
664
const plugin = getJsdocProcessorPlugin ( options ) ;
665
+ if ( ! plugin . processors || typeof plugin . processors . examples . preprocess !== 'function' ) {
666
+ throw new Error ( 'No processors' ) ;
667
+ }
668
+
654
669
const results = plugin . processors . examples . preprocess (
655
670
text , filename ,
656
671
) ;
@@ -662,6 +677,10 @@ describe('`getJsdocProcessorPlugin`', () => {
662
677
} ,
663
678
] ) ;
664
679
680
+ if ( ! plugin . processors || typeof plugin . processors . examples . postprocess !== 'function' ) {
681
+ throw new Error ( 'No processors' ) ;
682
+ }
683
+
665
684
const postResults = plugin . processors . examples . postprocess (
666
685
[
667
686
[ ] , [
@@ -700,6 +719,11 @@ describe('`getJsdocProcessorPlugin`', () => {
700
719
` ;
701
720
702
721
const plugin = getJsdocProcessorPlugin ( options ) ;
722
+
723
+ if ( ! plugin . processors || typeof plugin . processors . examples . preprocess !== 'function' ) {
724
+ throw new Error ( 'No processors' ) ;
725
+ }
726
+
703
727
const results = plugin . processors . examples . preprocess (
704
728
text , filename ,
705
729
) ;
@@ -711,6 +735,10 @@ describe('`getJsdocProcessorPlugin`', () => {
711
735
} ,
712
736
] ) ;
713
737
738
+ if ( ! plugin . processors || typeof plugin . processors . examples . postprocess !== 'function' ) {
739
+ throw new Error ( 'No processors' ) ;
740
+ }
741
+
714
742
const postResults = plugin . processors . examples . postprocess (
715
743
[
716
744
[ ] , [
@@ -750,6 +778,11 @@ describe('`getJsdocProcessorPlugin`', () => {
750
778
` ;
751
779
752
780
const plugin = getJsdocProcessorPlugin ( options ) ;
781
+
782
+ if ( ! plugin . processors || typeof plugin . processors . examples . preprocess !== 'function' ) {
783
+ throw new Error ( 'No processors' ) ;
784
+ }
785
+
753
786
const results = plugin . processors . examples . preprocess (
754
787
text , filename ,
755
788
) ;
@@ -761,6 +794,10 @@ describe('`getJsdocProcessorPlugin`', () => {
761
794
} ,
762
795
] ) ;
763
796
797
+ if ( ! plugin . processors || typeof plugin . processors . examples . postprocess !== 'function' ) {
798
+ throw new Error ( 'No processors' ) ;
799
+ }
800
+
764
801
const postResults = plugin . processors . examples . postprocess (
765
802
[
766
803
[ ] , [
0 commit comments