diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-09 06:46:43 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-09 06:46:43 -0500 |
commit | ac46df8daea09899ce30dc8fd70986e258c746bf (patch) | |
tree | 2750d3125fc253fd5b0671e4bd268eff1fd97296 /addon-sdk/source/test/test-jetpack-id.js | |
parent | 8cecf8d5208f3945b35f879bba3015bb1a11bec6 (diff) | |
download | UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.gz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.lz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.tar.xz UXP-ac46df8daea09899ce30dc8fd70986e258c746bf.zip |
Move Add-on SDK source to toolkit/jetpack
Diffstat (limited to 'addon-sdk/source/test/test-jetpack-id.js')
-rw-r--r-- | addon-sdk/source/test/test-jetpack-id.js | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/addon-sdk/source/test/test-jetpack-id.js b/addon-sdk/source/test/test-jetpack-id.js deleted file mode 100644 index 99479e32d..000000000 --- a/addon-sdk/source/test/test-jetpack-id.js +++ /dev/null @@ -1,64 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; - -var getID = require("jetpack-id/index"); - -exports["test Returns GUID when `id` GUID"] = assert => { - var guid = "{8490ae4f-93bc-13af-80b3-39adf9e7b243}"; - assert.equal(getID({ id: guid }), guid); -}; - -exports["test Returns domain id when `id` domain id"] = assert => { - var id = "my-addon@jetpack"; - assert.equal(getID({ id: id }), id); -}; - -exports["test allows underscores in name"] = assert => { - var name = "my_addon"; - assert.equal(getID({ name: name }), `@${name}`); -}; - -exports["test allows underscores in id"] = assert => { - var id = "my_addon@jetpack"; - assert.equal(getID({ id: id }), id); -}; - -exports["test Returns valid name when `name` exists"] = assert => { - var id = "my-addon"; - assert.equal(getID({ name: id }), `@${id}`); -}; - - -exports["test Returns null when `id` and `name` do not exist"] = assert => { - assert.equal(getID({}), null) -} - -exports["test Returns null when no object passed in"] = assert => { - assert.equal(getID(), null) -} - -exports["test Returns null when `id` exists but not GUID/domain"] = assert => { - var id = "my-addon"; - assert.equal(getID({ id: id }), null); -} - -exports["test Returns null when `id` contains multiple @"] = assert => { - assert.equal(getID({ id: "my@addon@yeah" }), null); -}; - -exports["test Returns null when `id` or `name` specified in domain format but has invalid characters"] = assert => { - [" ", "!", "/", "$", " ", "~", "("].forEach(sym => { - assert.equal(getID({ id: "my" + sym + "addon@domain" }), null); - assert.equal(getID({ name: "my" + sym + "addon" }), null); - }); -}; - -exports["test Returns null, does not crash, when providing non-string properties for `name` and `id`"] = assert => { - assert.equal(getID({ id: 5 }), null); - assert.equal(getID({ name: 5 }), null); - assert.equal(getID({ name: {} }), null); -}; - -require("sdk/test").run(exports); |