File tree 1 file changed +14
-1
lines changed
packages/doxdox-parser-custom/src
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
- import parse from './index' ;
1
+ import safe from 'safe-regex' ;
2
+
3
+ import parse , { JSDOC_PATTERN , IDENTIFIER_PATTERNS } from './index' ;
2
4
3
5
describe ( 'custom parser' , ( ) => {
4
6
describe ( 'parse' , ( ) => {
@@ -27,6 +29,17 @@ describe('custom parser', () => {
27
29
} ) ;
28
30
} ) ;
29
31
32
+ describe ( 'check regular expressions' , ( ) => {
33
+ it ( 'jsdoc pattern is safe' , ( ) => {
34
+ expect ( safe ( JSDOC_PATTERN ) ) . toBeTruthy ( ) ;
35
+ } ) ;
36
+ it ( 'identifier patterns are safe' , ( ) => {
37
+ for ( let i = 0 ; i < IDENTIFIER_PATTERNS . length ; i += 1 ) {
38
+ expect ( safe ( IDENTIFIER_PATTERNS [ i ] ) ) . toBeTruthy ( ) ;
39
+ }
40
+ } ) ;
41
+ } ) ;
42
+
30
43
describe ( 'parse example from JSDoc documentation https://jsdoc.app/' , ( ) => {
31
44
// JSDoc Example from https://jsdoc.app/
32
45
it ( 'parse amd-module' , async ( ) => {
You can’t perform that action at this time.
0 commit comments