diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 255a5c6..eeb38e8 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -28,3 +28,7 @@ about: Create a report to help us improve ## Additional context + +## Appreciation for the useful project + +- [ ] After the problem is resolved, do not forget to give a star ⭐ diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index 3ce0949..c017596 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -16,3 +16,7 @@ about: Suggest an idea for this project **Describe alternatives you've considered** + +## Appreciation for the useful project + +- [ ] After the feature is implemented, do not forget to give a star ⭐ diff --git a/.github/ISSUE_TEMPLATE/Other.md b/.github/ISSUE_TEMPLATE/Other.md index e1b38f2..1fd46e1 100644 --- a/.github/ISSUE_TEMPLATE/Other.md +++ b/.github/ISSUE_TEMPLATE/Other.md @@ -4,3 +4,7 @@ about: Something else --- + +## Appreciation for the useful project + +- [ ] Do not forget to give a star ⭐ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cd15179..6033f69 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -42,3 +42,7 @@ This PR contains a: - [ ] I have read the **CONTRIBUTING** document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. + +## Appreciation for the useful project + +- [ ] Do not forget to give a star ⭐ diff --git a/README.md b/README.md index 66eed2c..1db6faa 100644 --- a/README.md +++ b/README.md @@ -536,15 +536,15 @@ Define your own themes: import ansis from 'ansis'; const theme = { - error: ansis.red.bold, info: ansis.cyan.italic, - warning: ansis.black.bgYellowBright, + warn: ansis.black.bgYellowBright, + error: ansis.red.bold, ruby: ansis.hex('#E0115F'), }; -theme.error('error'); theme.info('info'); -theme.warning('warning'); +theme.warn('warning'); +theme.error('error'); theme.ruby('Ruby color'); ``` diff --git a/test/functional.test.js b/test/functional.test.js index a0f987e..509c728 100644 --- a/test/functional.test.js +++ b/test/functional.test.js @@ -455,4 +455,31 @@ describe('base ANSI 16 colors', () => { const expected = '\x1b[107mfoo\x1b[49m'; expect(esc(received)).toEqual(esc(expected)); }); +}); + +describe('custom theme', () => { + // define theme + const theme = { + info: ansis.green, + warn: ansis.yellow, + error: ansis.red, + }; + + test(`theme.info('info')`, () => { + const received = theme.info('info'); + const expected = '\x1b[32minfo\x1b[39m'; + expect(esc(received)).toEqual(esc(expected)); + }); + + test(`theme.warn('warn')`, () => { + const received = theme.warn('warn'); + const expected = '\x1b[33mwarn\x1b[39m'; + expect(esc(received)).toEqual(esc(expected)); + }); + + test(`theme.error('error')`, () => { + const received = theme.error('error'); + const expected = '\x1b[31merror\x1b[39m'; + expect(esc(received)).toEqual(esc(expected)); + }); }); \ No newline at end of file