UNPKG

ignore-sync

Version:

a CLI tool to build and sync *ignore files across files and repositories

46 lines (40 loc) 656 B
import highlightComments from './highlightComments.js' describe('highlightComments', () => { test('should add # correctly', () => { expect(highlightComments('a')).toBe( ` ##### # a # ##### `.trim(), ) expect(highlightComments('a\nbc')).toBe( ` ###### # a # # bc # ###### `.trim(), ) expect(highlightComments('ab\ncd')).toBe( ` ###### # ab # # cd # ###### `.trim(), ) expect(highlightComments('a\nbc\ndef')).toBe( ` ####### # a # # bc # # def # ####### `.trim(), ) }) test('should accept empty string', () => { expect(highlightComments('')).toBe('') }) })