const extractScriptJSComments = require('./extract-script-js-comments'); const inlineComments = ` Some text `; const multilineComments = ` Some text `; const outsideScript = ` Some text // comment 2 `; describe('extractScriptJSComments', () => { it('should catch inline comments', () => { const commentCounts = { 'comment 1': 2, 'comment 2': 1 }; expect(extractScriptJSComments(inlineComments)).toEqual(commentCounts); }); it('should catch multiline comments', () => { const commentCounts = { 'comment 1': 2, 'comment 2': 1 }; expect(extractScriptJSComments(multilineComments)).toEqual(commentCounts); }); it('should ignore comments outside script tags', () => { const commentCounts = { 'comment 1': 2, 'comment 2': 1 }; expect(extractScriptJSComments(outsideScript)).toEqual(commentCounts); }); });