File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 9
9
getRootDirPath ,
10
10
isDirectory ,
11
11
isFile ,
12
+ multiLinePatternMatch ,
12
13
parseConfigFromCLI ,
13
14
parseIgnoreConfig ,
14
15
slugify
@@ -98,6 +99,36 @@ describe('utils', () => {
98
99
} ) ;
99
100
} ) ;
100
101
102
+ describe ( 'multiLinePatternMatch' , ( ) => {
103
+ it ( 'find pattern in content' , async ( ) => {
104
+ expect (
105
+ multiLinePatternMatch (
106
+ `/**
107
+ * Get the current working directory.
108
+ *
109
+ * @return {string} Directory path.
110
+ * @public
111
+ */
112
+
113
+ function getCurrentWorkingDirectory() {}` ,
114
+ `/**
115
+ * Get the current working directory.
116
+ *
117
+ * @return {string} Directory path.
118
+ * @public
119
+ */`
120
+ )
121
+ ) . toEqual (
122
+ expect . objectContaining ( { matched : true , start : 0 , end : 6 } )
123
+ ) ;
124
+ } ) ;
125
+ it ( 'fail to find pattern' , async ( ) => {
126
+ expect ( multiLinePatternMatch ( '' , '// @ts-ignore' ) ) . toEqual (
127
+ expect . objectContaining ( { matched : false } )
128
+ ) ;
129
+ } ) ;
130
+ } ) ;
131
+
101
132
describe ( 'parseConfigFromCLI' , ( ) => {
102
133
it ( 'parse config' , ( ) => {
103
134
expect (
You can’t perform that action at this time.
0 commit comments