-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathacronym.spec.js
40 lines (31 loc) · 1.17 KB
/
acronym.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { parse } from './acronym';
describe('Acronyms are produced from', () => {
test('title cased phrases', () => {
expect(parse('Portable Network Graphics')).toEqual('PNG');
});
test('other title cased phrases', () => {
expect(parse('Ruby on Rails')).toEqual('ROR');
});
test('phrases with punctuation', () => {
expect(parse('First In, First Out')).toEqual('FIFO');
});
test('phrases with all uppercase words', () => {
expect(parse('GNU Image Manipulation Program')).toEqual('GIMP');
});
test('phrases with punctuation without whitespace', () => {
expect(parse('Complementary metal-oxide semiconductor')).toEqual('CMOS');
});
test('long phrases', () => {
expect(parse('Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me'))
.toEqual('ROTFLSHTMDCOALM');
});
test('phrases with consecutive delimiters', () => {
expect(parse('Something - I made up from thin air')).toEqual('SIMUFTA');
});
test('phrases with apostrophes', () => {
expect(parse("Halley's Comet")).toEqual('HC');
});
test('phrases with underscore emphasis', () => {
expect(parse('The Road _Not_ Taken')).toEqual('TRNT');
});
});