Skip to content

Commit 3c35616

Browse files
committed
feat: config tests setEmoji / getEmoji
1 parent 6c98c79 commit 3c35616

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const config = (() => {
1616

1717
const setEmoji = ({ type, emoji }) => {
1818
defaultConfig[type].emoji = emoji;
19+
return emoji;
1920
};
2021

2122
const getEmoji = type => defaultConfig[type].emoji;

tests/config.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import config from '../src/config';
2+
3+
describe('config', () => {
4+
test('should set emoji by type', () => {
5+
const expected = config.setEmoji({ type: 'info', emoji: '🦁' });
6+
expect(expected).toEqual('🦁');
7+
});
8+
9+
test('should get emoji by type', () => {
10+
const expected = config.getEmoji('error');
11+
console.log(expected);
12+
expect(expected).toEqual('🚫');
13+
});
14+
});

0 commit comments

Comments
 (0)