Skip to content

Commit

Permalink
docs: add bundlephobia badge (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoanalista authored Jul 2, 2022
1 parent f5ea0eb commit 8ece9a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Suitable for large teams working with multiple projects with their own commit sc
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![npm monthly downloads](https://img.shields.io/npm/dm/cz-customizable.svg?style=flat-square)](https://www.npmjs.com/package/cz-customizable)
[![bundlephobia](https://badgen.net/bundlephobia/minzip/cz-customizable)](https://bundlephobia.com/package/cz-customizable)


You have two ways to use `cz-customizable`. Originally, this project started as a commitizen plugin (Option 1). We introduced the second option to run this `cz-customizable` in standalone mode (Option 2), just like any NodeJS script. It's recommended to use `Option 2` for simplicity. The way you configure is shared between both options.
Expand Down
44 changes: 0 additions & 44 deletions __tests__/questions.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable nada/path-case */
const fs = require('fs');
const questions = require('../lib/questions.js');

describe('cz-customizable', () => {
Expand All @@ -10,10 +8,7 @@ describe('cz-customizable', () => {
});

const mockedCz = {
// Separator: jasmine.createSpy(),
// Separator: jest.fn().mockReturnValue(null),
Separator: jest.fn(),
// Separator: () => '',
};

const getQuestion = number => questions.getQuestions(config, mockedCz)[number - 1];
Expand Down Expand Up @@ -267,43 +262,4 @@ describe('cz-customizable', () => {
});
});
});

// TODO: fix tests
describe.skip('commit already prepared', () => {
let existsSync;
let readFileSync;

beforeEach(() => {
config = {};
existsSync = spyOn(fs, 'existsSync');
readFileSync = spyOn(fs, 'readFileSync');
});

it('should ignore if there is no prepared commit file', () => {
existsSync.andReturn(false);
expect(getQuestion(5).default).toEqual(null);
expect(getQuestion(6).default).toEqual(null);
});

it('should ignore an empty prepared commit', () => {
existsSync.andReturn(true);
readFileSync.andReturn('');
expect(getQuestion(5).default).toEqual(null);
expect(getQuestion(6).default).toEqual(null);
});

it('should take a single line commit as the subject', () => {
existsSync.andReturn(true);
readFileSync.andReturn('my commit');
expect(getQuestion(5).default).toEqual('my commit');
expect(getQuestion(6).default).toEqual(null);
});

it('should split multi line commit between the subject and the body', () => {
existsSync.andReturn(true);
readFileSync.andReturn('my commit\nmessage\n\nis on several lines');
expect(getQuestion(5).default).toEqual('my commit');
expect(getQuestion(6).default).toEqual(`message|is on several lines`);
});
});
});
2 changes: 2 additions & 0 deletions lib/build-commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const addTicketNumber = (ticketNumber, config) => {
if (!ticketNumber) {
return '';
}

if (config.ticketNumberPrefix) {
return `${config.ticketNumberPrefix + ticketNumber.trim()} `;
}

return `${ticketNumber.trim()} `;
};

Expand Down

0 comments on commit 8ece9a6

Please sign in to comment.