jetpack-id
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -11,5 +11,4 @@ /** | ||
return manifest.id; | ||
// Otherwise, append '@jetpack' to the id. `cfx` creates an | ||
// invalid `id`, so this needs to be supported | ||
return manifest.id + "@jetpack"; | ||
// Otherwise, this ID is invalid so return `null` | ||
return null; | ||
} | ||
@@ -16,0 +15,0 @@ |
{ | ||
"name": "jetpack-id", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Creates an ID from a Firefox Jetpack manifest", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,28 +5,37 @@ var getID = require("../"); | ||
describe("jetpack-id", function () { | ||
it("Returns GUID when `id` GUID", function () { | ||
var guid = "{8490ae4f-93bc-13af-80b3-39adf9e7b243}"; | ||
expect(getID({ id: guid })).to.be.equal(guid); | ||
describe("valid", function () { | ||
it("Returns GUID when `id` GUID", function () { | ||
var guid = "{8490ae4f-93bc-13af-80b3-39adf9e7b243}"; | ||
expect(getID({ id: guid })).to.be.equal(guid); | ||
}); | ||
it("Returns domain id when `id` domain id", function () { | ||
var id = "my-addon@jetpack"; | ||
expect(getID({ id: id })).to.be.equal(id); | ||
}); | ||
it("allows underscores in name", function () { | ||
var name = "my_addon"; | ||
expect(getID({ name: name })).to.be.equal("@" + name); | ||
}); | ||
it("allows underscores in id", function () { | ||
var id = "my_addon@jetpack"; | ||
expect(getID({ id: id })).to.be.equal(id); | ||
}); | ||
it("Returns valid name when `name` exists", function () { | ||
var id = "my-addon"; | ||
expect(getID({ name: id })).to.be.equal("@" + id); | ||
}); | ||
}); | ||
it("Returns domain id when `id` domain id", function () { | ||
var id = "my-addon@jetpack"; | ||
expect(getID({ id: id })).to.be.equal(id); | ||
describe("invalid", function () { | ||
it("Returns null when `id` and `name` do not exist", function () { | ||
expect(getID({})).to.be.equal(null); | ||
}); | ||
it("Returns null when no object passed in", function () { | ||
expect(getID()).to.be.equal(null); | ||
}); | ||
it("Returns null when `id` exists but not GUID/domain", function () { | ||
var id = "my-addon"; | ||
expect(getID({ id: id })).to.be.equal(null); | ||
}); | ||
}); | ||
it("Returns domain id when `id` exists but not GUID/domain", function () { | ||
var id = "my-addon"; | ||
expect(getID({ id: id })).to.be.equal(id + "@jetpack"); | ||
}); | ||
it("allows underscores in ID", function () { | ||
var id = "my_addon"; | ||
expect(getID({ id: id })).to.be.equal(id + "@jetpack"); | ||
}); | ||
it("Returns valid name when `name` exists", function () { | ||
var id = "my-addon"; | ||
expect(getID({ name: id })).to.be.equal("@" + id); | ||
}); | ||
it("Returns null when `id` and `name` do not exist", function () { | ||
expect(getID({})).to.be.equal(null); | ||
}); | ||
it("Returns null when no object passed in", function () { | ||
expect(getID()).to.be.equal(null); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4797
68