1 | /**
|
2 | * Test case for chop.
|
3 | * Runs with nodeunit.
|
4 | */
|
5 |
|
6 | var chop = require('../lib/chop.js');
|
7 |
|
8 | exports.setUp = function (done) {
|
9 | done();
|
10 | };
|
11 |
|
12 | exports.tearDown = function (done) {
|
13 | done();
|
14 | };
|
15 |
|
16 | exports['Chop'] = function (test) {
|
17 | var text = chop("This is a long long text", 18, {ellipsis: true});
|
18 | console.log(text);
|
19 | test.equal(chop('foobarbaz', 8, {ellipsis: true}), "fooba...");
|
20 | test.done();
|
21 | };
|
22 |
|