test: check replaced iff translatable comment
All translatable comments should be replaced, but nothing else.
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
d2ecd03013
commit
793fa8fb52
25
curriculum/test/utils/extract-js-comments.test.js
Normal file
25
curriculum/test/utils/extract-js-comments.test.js
Normal file
@ -0,0 +1,25 @@
|
||||
/* global expect */
|
||||
const extractJSComments = require('./extract-js-comments');
|
||||
|
||||
const someJS = `
|
||||
// single line comment
|
||||
|
||||
/*
|
||||
a multiline comment
|
||||
*/
|
||||
|
||||
var x = 'y'; // single line comment
|
||||
|
||||
var y = '// single line comment';
|
||||
|
||||
`;
|
||||
|
||||
describe('extractJSComments', () => {
|
||||
it('should return an object with comment keys and count values', () => {
|
||||
const commentCounts = {
|
||||
'single line comment': 2,
|
||||
'a multiline comment': 1
|
||||
};
|
||||
expect(extractJSComments(someJS)).toEqual(commentCounts);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user