is-valid-orcid
Version:
Check if a value is valid ORCID or not
34 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var index_1 = require("./index");
describe('isValidOrcid', function () {
it('returns false if it has less than 19 chars', function () {
var value = '0000-0001-5109-370';
expect(index_1.default(value)).toBe(false);
});
it('returns false if it does not have 16 chars after removing dashes', function () {
var value = '0000-0001-5109-370-';
expect(index_1.default(value)).toBe(false);
});
it('returns false if it is undefined', function () {
var value = undefined;
expect(index_1.default(value)).toBe(false);
});
it('returns false if it is null', function () {
var value = null;
expect(index_1.default(value)).toBe(false);
});
it('returns false if invalid orcid', function () {
var value = '0000-0002-0088-0052';
expect(index_1.default(value)).toBe(false);
});
it('returns true if valid orcid without X', function () {
var value = '0000-0001-5109-3700';
expect(index_1.default(value)).toBe(true);
});
it('returns true if valid orcid with X', function () {
var value = '0000-0002-1694-233X';
expect(index_1.default(value)).toBe(true);
});
});
//# sourceMappingURL=/home/travis/build/harunurhan/is-valid-orcid-js/src/index.spec.js.map