0c5d0d851ee578ece237cecfc825c288f245a547.svn-base
982 Bytes
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
41
42
/**
* package - Easy package.json exports.
*
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
/**
* Dependencies.
*/
var package = require('../');
describe('package', function() {
describe('read', function() {
it('should read and parse .json file', function() {
var result = package.read(__dirname + '/support/package.json');
result.should.eql({
name: 'test-package-json-file',
version: '0.0.1',
private: true
});
});
});
it('should read and parse given .json file', function() {
var result = package(__dirname + '/support');
result.should.eql({
name: 'test-package-json-file',
version: '0.0.1',
private: true
});
});
it('should autodiscover, read and parse package.json', function() {
var result = package(module);
result.should.eql({
name: 'test-package-json-file',
version: '0.0.1',
private: true
});
});
});