forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
525dd09
commit 267aabe
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
var mocha = require('..'); | ||
var utils = mocha.utils; | ||
var clean = utils.clean; | ||
var isBuffer = utils.isBuffer; | ||
|
||
describe('utils', function(){ | ||
describe('utils', function() { | ||
describe('.clean()', function(){ | ||
it('should remove the wrapping function declaration', function(){ | ||
clean('function (one, two, three) {\n//code\n}').should.equal('//code'); | ||
}) | ||
}); | ||
|
||
it('should remove space character indentation from the function body', function(){ | ||
clean(' //line1\n //line2').should.equal('//line1\n //line2'); | ||
}) | ||
}); | ||
|
||
it('should remove tab character indentation from the function body', function(){ | ||
clean('\t//line1\n\t\t//line2').should.equal('//line1\n\t//line2'); | ||
}); | ||
}); | ||
describe('.isBuffer()', function(){ | ||
it('should test if object is a Buffer', function() { | ||
isBuffer(new Buffer([0x01])).should.equal(true); | ||
isBuffer({}).should.equal(false); | ||
}) | ||
}) | ||
}) | ||
}); | ||
}); |