33 lines
3.1 KiB
JavaScript
33 lines
3.1 KiB
JavaScript
"use strict";
|
|
require("typings-test");
|
|
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');
|
|
});
|
|
it('should have .version', function () {
|
|
should(myNpm).have.property('version', '1.0.0');
|
|
});
|
|
it('should have .name', function () {
|
|
should(myNpm).have.property('name', 'testpackage');
|
|
});
|
|
it('should have .license', function () {
|
|
should(myNpm).have.property('license', 'MIT');
|
|
});
|
|
it('should have .git', function () {
|
|
should(myNpm.git.httpsUrl).equal('https://sometoken@github.com/someuser/somerepo.git');
|
|
});
|
|
});
|
|
describe('.getNpmNameForDir()', function () {
|
|
it('should return a name', function () {
|
|
should(projectinfo.getNpmNameForDir(testBasePath)).equal('testpackage');
|
|
});
|
|
});
|
|
});
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQiw2Q0FBNkM7QUFDN0MsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFBO0FBQzlCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQTtBQUMxQixJQUFJLFlBQVksR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFBO0FBRTFDLFFBQVEsQ0FBQyxhQUFhLEVBQUM7SUFDbkIsUUFBUSxDQUFD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