@@ -12,7 +12,7 @@ describe('snapshot-processor', () => {
1212 it ( 'should pass on untouched source code to source array' , ( ) => {
1313 const { preprocess } = snapshotProcessor ;
1414 const sourceCode = "const name = 'johnny bravo';" ;
15- const result = preprocess ( sourceCode ) ;
15+ const result = preprocess ( sourceCode , 'my-file.snap' ) ;
1616
1717 expect ( result ) . toEqual ( [ sourceCode ] ) ;
1818 } ) ;
@@ -21,13 +21,35 @@ describe('snapshot-processor', () => {
2121 describe ( 'postprocess function' , ( ) => {
2222 it ( 'should only return messages about snapshot specific rules' , ( ) => {
2323 const { postprocess } = snapshotProcessor ;
24- const result = postprocess ( [
25- [ 'no-console' , 'global-require' , 'jest/no-large-snapshots' ] . map (
26- ruleId => ( { ruleId } ) ,
27- ) ,
28- ] ) ;
2924
30- expect ( result ) . toEqual ( [ { ruleId : 'jest/no-large-snapshots' } ] ) ;
25+ const result = postprocess (
26+ [
27+ [ 'no-console' , 'global-require' , 'jest/no-large-snapshots' ] . map (
28+ ruleId => ( {
29+ ruleId,
30+ column : 1 ,
31+ line : 1 ,
32+ source : null ,
33+ nodeType : 'Program' ,
34+ message : 'something is not right about this...' ,
35+ severity : 1 ,
36+ } ) ,
37+ ) ,
38+ ] ,
39+ 'my-file.snap' ,
40+ ) ;
41+
42+ expect ( result ) . toEqual ( [
43+ {
44+ ruleId : 'jest/no-large-snapshots' ,
45+ column : 1 ,
46+ line : 1 ,
47+ source : null ,
48+ nodeType : 'Program' ,
49+ message : 'something is not right about this...' ,
50+ severity : 1 ,
51+ } ,
52+ ] ) ;
3153 } ) ;
3254 } ) ;
3355} ) ;
0 commit comments