From 00ef7540496570283d890c5ec2a55a0410183209 Mon Sep 17 00:00:00 2001 From: Emmanuel Ogbizi Date: Thu, 3 Dec 2020 18:21:13 +0000 Subject: [PATCH] fix: import 'sign-addon' correctly --- package.json | 2 +- src/publish.js | 2 +- tests/__mocks__/sign-addon.js | 3 -- tests/publish.test.js | 2 +- tests/verifyConditions.test.js | 4 +- yarn.lock | 77 +++++++--------------------------- 6 files changed, 19 insertions(+), 71 deletions(-) delete mode 100644 tests/__mocks__/sign-addon.js diff --git a/package.json b/package.json index fb51bc2..7778610 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint-plugin-prettier": "^3.1.0", "husky": "^4.0.1", "jest": "^26.0.1", - "jest-mock-props": "^1.7.2", + "jest-mock-module": "^0.1.3", "lint-staged": "^10.0.1", "memfs": "^3.0.3", "prettier": "^2.0.1", diff --git a/src/publish.js b/src/publish.js index c7243f3..ad0f63d 100644 --- a/src/publish.js +++ b/src/publish.js @@ -2,7 +2,7 @@ const fs = require('fs') const path = require('path') const webExt = require('web-ext') -const defaultAddonSigner = require('sign-addon').default +const { signAddon: defaultAddonSigner } = require('sign-addon') const { allowedChannels } = require('./constants') const { verifyOptions } = require('./utils') diff --git a/tests/__mocks__/sign-addon.js b/tests/__mocks__/sign-addon.js deleted file mode 100644 index a7d7a4b..0000000 --- a/tests/__mocks__/sign-addon.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - default: jest.fn(), -} diff --git a/tests/publish.test.js b/tests/publish.test.js index 86884ce..3ba588a 100644 --- a/tests/publish.test.js +++ b/tests/publish.test.js @@ -2,7 +2,7 @@ const fs = require('fs') const path = require('path') const { vol } = require('memfs') -const signAddon = require('sign-addon').default +const { signAddon } = require('sign-addon') const { publish } = require('../src') diff --git a/tests/verifyConditions.test.js b/tests/verifyConditions.test.js index 5ffaea0..4bba095 100644 --- a/tests/verifyConditions.test.js +++ b/tests/verifyConditions.test.js @@ -1,10 +1,8 @@ const { vol } = require('memfs') -const mockProps = require('jest-mock-props') +require('jest-mock-props').extend(jest) const { verifyConditions } = require('../src') -mockProps.extend(jest) - describe('verifyConditions', () => { const firefoxApiKeySpy = jest.spyOnProp(process.env, 'FIREFOX_API_KEY') const firefoxSecretKeySpy = jest.spyOnProp( diff --git a/yarn.lock b/yarn.lock index b09309b..093ee19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1477,14 +1477,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" - integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== - dependencies: - "@babel/types" "^7.3.0" - -"@types/babel__traverse@^7.0.4": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.15.tgz#db9e4238931eb69ef8aab0ad6523d4d4caa39d03" integrity sha512-Pzh9O3sTK8V6I1olsXpCfj2k/ygO2q1X0vhhnDrEQyYLHZesWz+zMZMVcwXLCYf0U36EtmyYaFGPfXlTtDHe3A== @@ -2313,11 +2306,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@^1.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== - base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -2542,15 +2530,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -buffer@^5.1.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.0.tgz#33294f5c1f26e08461e528b69fa06de3c45cbd8c" - integrity sha512-Xpgy0IwHK2N01ncykXTy6FpCWuM+CJSHoPVBLyNqyrWxsedpLvwsYUhf0ME3WRFNUhos0dMamz9cOS/xRDtU5g== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -buffer@^5.2.1: +buffer@^5.1.0, buffer@^5.2.1, buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -2558,14 +2538,6 @@ buffer@^5.2.1: base64-js "^1.3.1" ieee754 "^1.1.13" -buffer@^5.5.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -4342,12 +4314,7 @@ estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642" - integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== - -estraverse@^5.2.0: +estraverse@^5.1.0, estraverse@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== @@ -4964,7 +4931,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@2.2.1: +fsevents@2.2.1, fsevents@^2.1.2: version "2.2.1" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== @@ -4977,7 +4944,7 @@ fsevents@^1.2.7: nan "^2.12.1" node-pre-gyp "^0.12.0" -fsevents@^2.1.2, fsevents@~2.1.2: +fsevents@~2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== @@ -5592,11 +5559,6 @@ ieee754@^1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" @@ -6443,7 +6405,14 @@ jest-message-util@^26.6.2: slash "^3.0.0" stack-utils "^2.0.2" -jest-mock-props@^1.7.2: +jest-mock-module@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/jest-mock-module/-/jest-mock-module-0.1.3.tgz#910a95b8e4f3935b868dd9895b8a2b3bfcf15aa8" + integrity sha512-5W2Xl2iz6Q2X/0w2rDVDGfRvhcwggUXShCzcc3Zqw1u+eVVnIsrR9hU6gzmI2pq+X24BPUG9/HY2rWIvlzyzuQ== + dependencies: + jest-mock-props "^1.8.2" + +jest-mock-props@^1.8.2: version "1.8.2" resolved "https://registry.yarnpkg.com/jest-mock-props/-/jest-mock-props-1.8.2.tgz#12c531b7c72d63efbffa8e18d4d8a7ace1979bc8" integrity sha512-g3Pkf6O808nMsHlAAyzTOIFvdZ/Q1Almu/1WJsWXZlFJE/UnuIb76DEr8uB+fTiATGlGotrICDta7c7agaOGOQ== @@ -9659,14 +9628,7 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rxjs@^6.4.0, rxjs@^6.5.3: - version "6.6.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.2.tgz#8096a7ac03f2cc4fe5860ef6e572810d9e01c0d2" - integrity sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg== - dependencies: - tslib "^1.9.0" - -rxjs@^6.6.3: +rxjs@^6.4.0, rxjs@^6.5.3, rxjs@^6.6.3: version "6.6.3" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== @@ -11346,7 +11308,7 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@8.4.0: +whatwg-url@8.4.0, whatwg-url@^8.0.0: version "8.4.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837" integrity sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw== @@ -11355,15 +11317,6 @@ whatwg-url@8.4.0: tr46 "^2.0.2" webidl-conversions "^6.1.0" -whatwg-url@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.1.0.tgz#c628acdcf45b82274ce7281ee31dd3c839791771" - integrity sha512-vEIkwNi9Hqt4TV9RdnaBPNt+E2Sgmo3gePebCRgZ1R7g6d23+53zCTnuB0amKI4AXq6VM8jj2DUAa0S1vjJxkw== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^2.0.2" - webidl-conversions "^5.0.0" - when@3.7.7: version "3.7.7" resolved "https://registry.yarnpkg.com/when/-/when-3.7.7.tgz#aba03fc3bb736d6c88b091d013d8a8e590d84718"