UNPKG

416 BJavaScriptView Raw
1/**
2 * Test case for chop.
3 * Runs with nodeunit.
4 */
5
6var chop = require('../lib/chop.js');
7
8exports.setUp = function (done) {
9 done();
10};
11
12exports.tearDown = function (done) {
13 done();
14};
15
16exports['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