@@ -180,6 +180,42 @@ export class ExpectModule {
180
180
} ) ;
181
181
}
182
182
183
+ doesNotIncludeContent ( src : string , message ?: string ) {
184
+ if ( ! this . module ) {
185
+ this . emitMissingModule ( ) ;
186
+ return ;
187
+ }
188
+ if ( this . module . type === 'unparseable' ) {
189
+ this . emitUnparsableModule ( message ) ;
190
+ return ;
191
+ }
192
+
193
+ this . expectAudit . assert . pushResult ( {
194
+ result : ! this . module . content . includes ( src ) ,
195
+ actual : this . module . content ,
196
+ expected : true ,
197
+ message : message ?? `Expected ${ this . inputName } to not contain ${ src } ` ,
198
+ } ) ;
199
+ }
200
+
201
+ includesContent ( src : string , message ?: string ) {
202
+ if ( ! this . module ) {
203
+ this . emitMissingModule ( ) ;
204
+ return ;
205
+ }
206
+ if ( this . module . type === 'unparseable' ) {
207
+ this . emitUnparsableModule ( message ) ;
208
+ return ;
209
+ }
210
+
211
+ this . expectAudit . assert . pushResult ( {
212
+ result : this . module . content . includes ( src ) ,
213
+ actual : this . module . content ,
214
+ expected : true ,
215
+ message : message ?? `Expected ${ this . inputName } to contain ${ src } ` ,
216
+ } ) ;
217
+ }
218
+
183
219
private emitUnparsableModule ( message ?: string ) {
184
220
this . expectAudit . assert . pushResult ( {
185
221
result : false ,
@@ -327,6 +363,8 @@ class EmptyExpectModule implements PublicAPI<ExpectModule> {
327
363
codeEquals ( ) { }
328
364
codeContains ( ) { }
329
365
withContents ( ) { }
366
+ doesNotIncludeContent ( ) { }
367
+ includesContent ( ) { }
330
368
331
369
resolves ( ) : PublicAPI < ExpectResolution > {
332
370
return new EmptyExpectResolution ( ) as PublicAPI < ExpectResolution > ;
0 commit comments