Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some emoji spinners #46

Merged
merged 15 commits into from
Mar 18, 2021
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"devDependencies": {
"ava": "^1.4.1",
"log-update": "^3.2.0",
"string-length": "^4.0.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
Expand Down
126 changes: 123 additions & 3 deletions spinners.json
Original file line number Diff line number Diff line change
Expand Up @@ -1233,10 +1233,10 @@
"grenade": {
"interval": 80,
"frames": [
",
"′ ",
"، ",
"′ ",
" ´ ",
" ‾ ",
" ‾ ",
" ⸌",
" ⸊",
" |",
Expand Down Expand Up @@ -1279,6 +1279,126 @@
"ββββββρ"
]
},
"fingerDance": {
"interval": 160,
"frames": [
"🤘 ",
"🤟 ",
"🖖 ",
"✋ ",
"🤚 ",
"👆 "
]
},
"fistBump": {
"interval": 80,
"frames": [
"🤜\u3000\u3000\u3000\u3000🤛 ",
"🤜\u3000\u3000\u3000\u3000🤛 ",
"🤜\u3000\u3000\u3000\u3000🤛 ",
"\u3000🤜\u3000\u3000🤛\u3000 ",
"\u3000\u3000🤜🤛\u3000\u3000 ",
"\u3000🤜✨🤛\u3000\u3000 ",
"🤜\u3000✨\u3000🤛\u3000 "
]
},
"soccerHeader": {
"interval": 80,
"frames": [
" 🧑⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 "
]
},
"mindblown": {
"interval": 160,
"frames": [
"😐 ",
"😐 ",
"😮 ",
"😮 ",
"😦 ",
"😦 ",
"😧 ",
"😧 ",
"🤯 ",
"💥 ",
"✨ ",
"\u3000 ",
"\u3000 ",
"\u3000 "
]
},
"speaker": {
"interval": 160,
"frames": [
"🔈 ",
"🔉 ",
"🔊 ",
"🔉 "
]
},
"orangePulse": {
"interval": 100,
"frames": [
"🔸 ",
"🔶 ",
"🟠 ",
"🟠 ",
"🔶 "
]
},
"bluePulse": {
"interval": 100,
"frames": [
"🔹 ",
"🔷 ",
"🔵 ",
"🔵 ",
"🔷 "
]
},
"orangeBluePulse": {
"interval": 100,
"frames": [
"🔸 ",
"🔶 ",
"🟠 ",
"🟠 ",
"🔶 ",
"🔹 ",
"🔷 ",
"🔵 ",
"🔵 ",
"🔷 "
]
},
"timeTravel": {
"interval": 100,
"frames": [
"🕛 ",
"🕚 ",
"🕙 ",
"🕘 ",
"🕗 ",
"🕖 ",
"🕕 ",
"🕔 ",
"🕓 ",
"🕒 ",
"🕑 ",
"🕐 "
]
},
"aesthetic": {
"interval": 80,
"frames": [
Expand Down
24 changes: 24 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import test from 'ava';
import stringLength from 'string-length';

import cliSpinners from '.';

function mockMathRandom(fixedResult) {
Expand All @@ -22,6 +24,28 @@ test('main', t => {
t.true(Array.isArray(cliSpinners.dots.frames));
});

test('constant width', t => {
for (const key of Object.keys(cliSpinners)) {
// TODO: Remove this if statement when "module.exports.default = spinners" is removed from index.js.
if (key === 'default') {
continue;
}

const {
[key]: {
frames,
frames: [
firstFrame
]
}
} = cliSpinners;

const firstFrameLength = stringLength(firstFrame);

t.true(frames.every(frame => stringLength(frame) === firstFrameLength));
}
});

test('random getter', t => {
const spinnersList = Object.keys(cliSpinners)
// TODO: Remove this filter when "module.exports.default = spinners" is removed from index.js.
Expand Down