forked from csscomb/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat.js
More file actions
22 lines (19 loc) · 722 Bytes
/
format.js
File metadata and controls
22 lines (19 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var assert = require('assert');
var format = require('../lib/format');
describe('Message formatter', function() {
it('should replace line breaks with a single space', function() {
var string = 'a\nb\nc\n';
var expected = 'a b c ';
assert.equal(expected, format(string));
});
it('should replace line breaks and multiple spaces with a single space', function() {
var string = 'a\n b\n c\n';
var expected = 'a b c ';
assert.equal(expected, format(string));
});
it('should save spaces before line breaks', function() {
var string = 'a \nb\nc \n';
var expected = 'a b c ';
assert.equal(expected, format(string));
});
});