projectinfo/test/test.js

33 lines
3.1 KiB
JavaScript
Raw Normal View History

2016-06-09 01:13:40 +00:00
"use strict";
require("typings-test");
2016-11-26 13:45:56 +00:00
const projectinfo = require("../dist/index");
let should = require('should');
let path = require('path');
let testBasePath = path.resolve(__dirname);
describe('projectinfo', function () {
describe('.npm() return', function () {
let myNpm = new projectinfo.ProjectinfoNpm(testBasePath, { gitAccessToken: 'sometoken' });
it('should have .packageJson', function () {
should(myNpm.packageJson).have.property('version', '1.0.0');
should(myNpm.packageJson).have.property('name', 'testpackage');
2016-02-20 04:05:07 +00:00
});
2016-11-26 13:45:56 +00:00
it('should have .version', function () {
should(myNpm).have.property('version', '1.0.0');
2016-02-20 04:05:07 +00:00
});
2016-11-26 13:45:56 +00:00
it('should have .name', function () {
should(myNpm).have.property('name', 'testpackage');
2016-02-20 04:05:07 +00:00
});
2016-11-26 13:45:56 +00:00
it('should have .license', function () {
should(myNpm).have.property('license', 'MIT');
2016-02-21 16:17:31 +00:00
});
2016-11-26 13:45:56 +00:00
it('should have .git', function () {
should(myNpm.git.httpsUrl).equal('https://sometoken@github.com/someuser/somerepo.git');
2016-02-23 07:48:41 +00:00
});
2016-02-20 04:05:07 +00:00
});
2016-11-26 13:45:56 +00:00
describe('.getNpmNameForDir()', function () {
it('should return a name', function () {
should(projectinfo.getNpmNameForDir(testBasePath)).equal('testpackage');
2016-02-20 05:06:43 +00:00
});
});
2016-02-20 04:05:07 +00:00
});
2016-11-26 13:45:56 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQiw2Q0FBNkM7QUFDN0MsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFBO0FBQzlCLElBQUksSUFBSSxHQUFHLE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