@dxdeveloperexperience/hygie
Version:
Hygie is an easy-to-use Open-Source REST API allowing you to interact with GIT events. This NestJS API expose a set of customizable rules to automate your project's life cycle.
47 lines (43 loc) • 1.24 kB
text/typescript
import { getAllComments } from './utils';
describe('Utils', () => {
it('should return a array of comments', () => {
const result = getAllComments(`
/**
* Options supported in the .rulesrc file
*/
export class RulesOptions {
/**
* Specify if the process continue when a rule does not succeed
*/
executeAllRules: boolean = false;
/**
* Specify if rules will be processed
*/
enableRules: boolean = true;
/**
* Specify if groups will be processed
*/
enableGroups: boolean = true;
constructor(r?: RulesOptions) {
if (r !== undefined && r !== null) {
this.executeAllRules =
typeof r.executeAllRules === 'undefined'
? this.executeAllRules
: r.executeAllRules;
this.enableRules =
typeof r.enableRules === 'undefined' ? this.enableRules : r.enableRules;
this.enableGroups =
typeof r.enableGroups === 'undefined'
? this.enableGroups
: r.enableGroups;
}
}
}`);
expect(result).toEqual([
'Options supported in the .rulesrc file',
'Specify if the process continue when a rule does not succeed',
'Specify if rules will be processed',
'Specify if groups will be processed',
]);
});
});