|
|
@@ -17,7 +17,12 @@ |
|
|
|
* along with this program; if not, write to the Free Software Foundation, |
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
|
|
*/ |
|
|
|
import { getFrontMatter, separateFrontMatter } from '../markdown'; |
|
|
|
import { getFrontMatter, separateFrontMatter, filterContent } from '../markdown'; |
|
|
|
|
|
|
|
jest.mock('../system', () => ({ |
|
|
|
getInstance: () => 'SonarQube', |
|
|
|
isSonarCloud: () => false |
|
|
|
})); |
|
|
|
|
|
|
|
it('returns parsed frontmatter of one item', () => { |
|
|
|
expect( |
|
|
@@ -105,3 +110,9 @@ it('returns full content when frontmatter has bad formatting', () => { |
|
|
|
|
|
|
|
expect(separateFrontMatter(content)).toEqual({ content, frontmatter: {} }); |
|
|
|
}); |
|
|
|
|
|
|
|
it('replaces {instance}', () => { |
|
|
|
expect( |
|
|
|
filterContent('This is {instance} content. It replaces all {instance}{instance} messages') |
|
|
|
).toBe('This is SonarQube content. It replaces all SonarQubeSonarQube messages'); |
|
|
|
}); |