From 9b953514dd84d23190bb99dd39ac2d4dbe343d57 Mon Sep 17 00:00:00 2001 From: Waldek Mastykarz Date: Tue, 31 Dec 2019 20:02:09 +0100 Subject: [PATCH] Changed coverage to use c8 instead of nyc solving #1271 --- .c8rc.json | 4 + .circleci/config.yml | 4 +- npm-shrinkwrap.json | 1984 +++++------------ package.json | 10 +- src/Auth.ts | 3 +- src/Command.ts | 1 - src/Utils.spec.ts | 21 +- src/Utils.ts | 2 +- src/autocomplete.spec.ts | 20 + src/config.spec.ts | 39 + src/o365/base/AzmgmtItemsListCommand.ts | 1 - src/o365/base/GraphItemsListCommand.ts | 1 - .../schemaextension/schemaextension-add.ts | 37 +- .../project/project-externalize.spec.ts | 132 +- .../rules/DynamicRule.spec.ts | 52 +- .../project-externalize/rules/DynamicRule.ts | 159 +- .../commands/project/project-upgrade.spec.ts | 248 ++- .../project-upgrade/model/ScssFile.spec.ts | 17 + .../project-upgrade/model/TsFile.spec.ts | 13 +- .../FN001001_DEP_microsoft_sp_core_library.ts | 1 - ...FN001002_DEP_microsoft_sp_lodash_subset.ts | 1 - ..._DEP_microsoft_sp_office_ui_fabric_core.ts | 1 - .../FN001004_DEP_microsoft_sp_webpart_base.ts | 1 - .../rules/FN001005_DEP_types_react.ts | 1 - .../rules/FN001006_DEP_types_react_dom.ts | 1 - .../rules/FN001007_DEP_types_webpack_env.ts | 1 - .../rules/FN001008_DEP_react.ts | 1 - .../rules/FN001009_DEP_react_dom.ts | 1 - .../rules/FN001010_DEP_types_es6_promise.ts | 1 - .../rules/FN001011_DEP_microsoft_sp_dialog.ts | 1 - ...01012_DEP_microsoft_sp_application_base.ts | 1 - .../FN001013_DEP_microsoft_decorators.ts | 1 - ...DEP_microsoft_sp_listview_extensibility.ts | 1 - ..._DEP_types_react_addons_shallow_compare.ts | 1 - .../FN001016_DEP_types_react_addons_update.ts | 1 - .../FN001017_DEP_types_react_addons_update.ts | 1 - .../FN001018_DEP_microsoft_sp_client_base.ts | 1 - .../rules/FN001019_DEP_knockout.ts | 1 - .../rules/FN001020_DEP_types_knockout.ts | 1 - ...FN001021_DEP_microsoft_sp_property_pane.ts | 1 - .../FN001022_DEP_office_ui_fabric_react.ts | 1 - .../FN002001_DEVDEP_microsoft_sp_build_web.ts | 1 - ...2_DEVDEP_microsoft_sp_module_interfaces.ts | 1 - ...3_DEVDEP_microsoft_sp_webpart_workbench.ts | 1 - .../rules/FN002004_DEVDEP_gulp.ts | 1 - .../rules/FN002005_DEVDEP_types_chai.ts | 1 - .../rules/FN002006_DEVDEP_types_mocha.ts | 1 - .../rules/FN002007_DEVDEP_ajv.ts | 1 - ...N002008_DEVDEP_tslint_microsoft_contrib.ts | 1 - ...002009_DEVDEP_microsoft_sp_tslint_rules.ts | 1 - ...EVDEP_microsoft_rush_stack_compiler_2_7.ts | 1 - ...EVDEP_microsoft_rush_stack_compiler_2_9.ts | 1 - .../rules/FN003003_CFG_bundles.ts | 12 +- .../rules/FN011001_MAN_webpart_schema.ts | 2 +- ...011002_MAN_applicationCustomizer_schema.ts | 2 +- .../FN011003_MAN_listViewCommandSet_schema.ts | 2 +- .../FN011004_MAN_fieldCustomizer_schema.ts | 2 +- .../FN011005_MAN_webpart_defaultGroup.ts | 2 +- ...AN_webpart_safeWithCustomScriptDisabled.ts | 2 +- .../FN011011_MAN_webpart_supportedHosts.ts | 2 +- .../rules/FN015001_FILE_typings_tsd_d_ts.ts | 1 - .../FN015002_FILE_typings__ms_odsp_d_ts.ts | 1 - .../rules/FN015003_FILE_tslint_json.ts | 1 - .../rules/FN015004_FILE_config_tslint_json.ts | 1 - .../rules/FN015005_FILE_src_index_ts.ts | 1 - .../FN016001_TS_msgraphclient_packageName.ts | 2 +- .../FN016002_TS_msgraphclient_instance.ts | 1 - .../FN016003_TS_aadhttpclient_instance.ts | 1 - ...016004_TS_property_pane_property_import.ts | 1 - .../rules/FN017001_MISC_npm_dedupe.ts | 1 - .../rules/FN018001_TEAMS_folder.ts | 1 - .../rules/FN018002_TEAMS_manifest.ts | 1 - .../rules/FN018003_TEAMS_tab20x20_png.ts | 1 - .../rules/FN018004_TEAMS_tab96x96_png.ts | 1 - .../rules/FN020001_RES_types_react.ts | 1 - .../rules/FN021001_PKG_main.ts | 1 - .../FN022001_SCSS_remove_fabric_react.ts | 1 - .../rules/FN022002_SCSS_add_fabric_react.ts | 1 - src/o365/spo/commands/apppage/apppage-set.ts | 2 +- .../contenttype/contenttype-field-set.ts | 2 +- .../spo/commands/hubsite/hubsite-list.spec.ts | 143 +- src/o365/spo/commands/hubsite/hubsite-list.ts | 72 +- .../spo/commands/listitem/listitem-add.ts | 2 +- .../page/page-clientsidewebpart-add.spec.ts | 24 + .../page/page-clientsidewebpart-add.ts | 13 +- .../commands/propertybag/propertybag-base.ts | 1 - src/o365/spo/commands/term/term-add.spec.ts | 10 + .../spo/commands/term/term-set-add.spec.ts | 5 + src/o365/spo/commands/theme/theme-get.ts | 3 +- src/o365/spo/commands/web/web-reindex.ts | 2 +- .../yammer/commands/message/message-list.ts | 1 - src/o365/yammer/commands/user/user-list.ts | 1 - tsconfig.json | 2 +- 93 files changed, 1402 insertions(+), 1707 deletions(-) create mode 100644 .c8rc.json create mode 100644 src/config.spec.ts create mode 100644 src/o365/spfx/commands/project/project-upgrade/model/ScssFile.spec.ts diff --git a/.c8rc.json b/.c8rc.json new file mode 100644 index 00000000000..008904cdf6b --- /dev/null +++ b/.c8rc.json @@ -0,0 +1,4 @@ +{ + "exclude": ["**/*.spec.js", "**/clientsidepages.js"], + "reporter": ["lcov", "text", "text-summary"] +} \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml index 2031f998275..8aeb4b94811 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ defaults: &defaults working_directory: ~/office365-cli docker: - - image: circleci/node:10.15.3 + - image: circleci/node:12.14.0 version: 2 jobs: @@ -36,7 +36,7 @@ jobs: command: npm test - run: name: Run coveralls - command: './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls' + command: './node_modules/.bin/c8 report --reporter=text-lcov | ./node_modules/.bin/coveralls' environment: - COVERALLS_REPO_TOKEN: "VsEM7x54Sb8kg1sjzpA6aafoyvlcTtM30" - COVERALLS_SERVICE_NAME: "circle-ci" diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 442698406e1..ce9dd710d79 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,176 +4,15 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", - "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", - "dev": true, - "requires": { - "@babel/types": "^7.4.4", - "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } - } - }, - "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", - "dev": true, - "requires": { - "@babel/types": "^7.4.4" - } - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@babel/parser": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", - "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", - "dev": true - }, - "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" - } - }, - "@babel/traverse": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", - "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.5", - "@babel/types": "^7.4.4", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.11" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } - } + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, - "@babel/types": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", - "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.11", - "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } - } + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==" }, "@sindresorhus/is": { "version": "0.14.0", @@ -238,12 +77,27 @@ "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", "dev": true }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, "@types/easy-table": { "version": "0.0.32", "resolved": "https://registry.npmjs.org/@types/easy-table/-/easy-table-0.0.32.tgz", "integrity": "sha512-zKh0f/ixYFnr3Ldf5ZJTi1ZpnRqAynTTtVyGvWDf/TT12asE8ac98t3/WGWfFdRPp/qsccxg82C/Kl3NPNhqEw==", "dev": true }, + "@types/is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@types/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-byTuSHMdMRaOpRBhDW3RXl/Jxv8=" + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==" + }, "@types/mocha": { "version": "5.2.7", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", @@ -550,8 +404,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "bcrypt-pbkdf": { "version": "1.0.1", @@ -637,7 +490,6 @@ "version": "1.1.8", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -654,6 +506,165 @@ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, + "c8": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.0.0.tgz", + "integrity": "sha512-4X920F1QhyHqZKHsmwUuUVA3GrJ5vwqKd1iqnMB/G+KiydNF3TtM3FqNFMzHI0t+pa1xMa6TZwtt67bTlYzVPQ==", + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.2", + "find-up": "^4.0.0", + "foreground-child": "^2.0.0", + "furi": "^1.3.0", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.0", + "rimraf": "^3.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^4.0.1", + "yargs": "^15.0.0", + "yargs-parser": "^16.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", + "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.0.2.tgz", + "integrity": "sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^16.1.0" + } + }, + "yargs-parser": { + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", + "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -853,8 +864,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "configstore": { "version": "4.0.0", @@ -878,6 +888,14 @@ "emitter-listener": "^1.1.1" } }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "requires": { + "safe-buffer": "~5.1.1" + } + }, "core-js": { "version": "2.6.10", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", @@ -1081,8 +1099,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "decompress-response": { "version": "3.3.0", @@ -1258,12 +1275,6 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -1330,6 +1341,53 @@ "is-buffer": "~2.0.3" } }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", + "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -1348,8 +1406,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "function-bind": { "version": "1.1.1", @@ -1357,11 +1414,19 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "furi": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/furi/-/furi-1.3.0.tgz", + "integrity": "sha512-TYoXEeRLKHXNWcCBP0VH1psPktQ9G8Y0GfZwMXCvwVbhbfNx7JItKWhB5mMBYufNjqxEHq+Ivd1nLtr5vQyVoQ==", + "requires": { + "@types/is-windows": "^0.2.0", + "is-windows": "^1.0.2" + } + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-stream": { "version": "3.0.0", @@ -1380,7 +1445,6 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1398,12 +1462,6 @@ "ini": "^1.3.4" } }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -1496,6 +1554,11 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "html-escaper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", + "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==" + }, "http-cache-semantics": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", @@ -1530,7 +1593,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -1539,8 +1601,7 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", @@ -1663,6 +1724,11 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, "is-yarn-global": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", @@ -1684,33 +1750,53 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", - "dev": true + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==" + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "requires": { + "semver": "^6.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "requires": { + "has-flag": "^4.0.0" + } + } + } }, - "istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", - "dev": true, + "istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" } }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -1727,12 +1813,6 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "optional": true }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -1899,1226 +1979,191 @@ "requires": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - } - }, - "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" - }, - "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", - "requires": { - "mime-db": "~1.30.0" - } - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "mocha": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.1.tgz", - "integrity": "sha512-VCcWkLHwk79NYQc8cxhkmI8IigTIhsCwZ6RTxQsqK6go4UvEhzJkYuHm8B2YtlSxcYq2fY+ucr4JBwoD6ci80A==", - "dev": true, - "requires": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "2.2.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-environment-flags": "1.0.5", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.0", - "yargs-parser": "13.1.1", - "yargs-unparser": "1.6.0" - }, - "dependencies": { - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=" - }, - "nise": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", - "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^4.1.0", - "path-to-regexp": "^1.7.0" - } - }, - "node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "node-forge": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", - "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==" - }, - "node-localstorage": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-0.6.0.tgz", - "integrity": "sha1-RaBgHGky395mRKIzYfG+Fzx1068=" - }, - "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "nyc": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz", - "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "arrify": "^1.0.1", - "caching-transform": "^3.0.1", - "convert-source-map": "^1.6.0", - "find-cache-dir": "^2.0.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.1", - "make-dir": "^1.3.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", - "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.1.0", - "uuid": "^3.3.2", - "yargs": "^12.0.5", - "yargs-parser": "^11.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "append-transform": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, - "archy": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "async": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "caching-transform": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "hasha": "^3.0.0", - "make-dir": "^1.3.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.3.0" - } - }, - "camelcase": { - "version": "5.0.0", - "bundled": true, - "dev": true - }, - "cliui": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "commander": { - "version": "2.17.1", - "bundled": true, - "dev": true, - "optional": true - }, - "commondir": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "convert-source-map": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cross-spawn": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "default-require-extensions": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, - "end-of-stream": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "bundled": true, - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es6-error": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "execa": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "bundled": true, - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, - "find-cache-dir": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "foreground-child": { - "version": "1.5.6", - "bundled": true, - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "bundled": true, - "dev": true - }, - "handlebars": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "has-flag": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "hasha": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-stream": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.7.1", - "bundled": true, - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "isexe": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "istanbul-lib-hook": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, - "istanbul-lib-report": { - "version": "2.0.4", - "bundled": true, - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "istanbul-reports": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "handlebars": "^4.1.0" - } - }, - "json-parse-better-errors": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "lcid": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.11", - "bundled": true, - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "bundled": true, - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "bundled": true, - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "bundled": true, - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "mem": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^2.0.0" - } - }, - "merge-source-map": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true - } - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.10", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - } - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "bundled": true, - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "p-is-promise": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "p-limit": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "package-hash": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-key": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "bundled": true, - "dev": true - }, - "path-type": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "pump": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "read-pkg": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "require-directory": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "resolve": { - "version": "1.10.0", - "bundled": true, - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.6.0", - "bundled": true, - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "spawn-wrap": { - "version": "1.4.2", - "bundled": true, - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "bundled": true, - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.3", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "bundled": true, + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "requires": { + "pify": "^3.0.0" + } + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "~1.30.0" + } + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true - }, - "test-exclude": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "arrify": "^1.0.1", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" - } - }, - "uglify-js": { - "version": "3.4.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "uuid": { - "version": "3.3.2", - "bundled": true, + } + } + }, + "mocha": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.1.tgz", + "integrity": "sha512-VCcWkLHwk79NYQc8cxhkmI8IigTIhsCwZ6RTxQsqK6go4UvEhzJkYuHm8B2YtlSxcYq2fY+ucr4JBwoD6ci80A==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "2.2.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "ms": "2.1.1", + "node-environment-flags": "1.0.5", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.0", + "yargs-parser": "13.1.1", + "yargs-unparser": "1.6.0" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "bundled": true, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "has-flag": "^3.0.0" } }, "which": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" } - }, - "which-module": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "bundled": true, - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "write-file-atomic": { - "version": "2.4.2", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "y18n": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "2.1.2", - "bundled": true, + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "mute-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=" + }, + "nise": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", + "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^4.1.0", + "path-to-regexp": "^1.7.0" + } + }, + "node-environment-flags": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true - }, - "yargs": { - "version": "12.0.5", - "bundled": true, - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "bundled": true, - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, + "node-forge": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", + "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==" + }, + "node-localstorage": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-0.6.0.tgz", + "integrity": "sha1-RaBgHGky395mRKIzYfG+Fzx1068=" + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -3195,7 +2240,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -3212,8 +2256,7 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "package-json": { "version": "6.5.0", @@ -3235,8 +2278,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -3435,14 +2477,12 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "responselike": { "version": "1.0.2", @@ -3465,7 +2505,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -3511,8 +2550,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "shebang-command": { "version": "1.2.0", @@ -3563,12 +2601,6 @@ } } }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -3661,17 +2693,36 @@ "execa": "^0.7.0" } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -3685,12 +2736,6 @@ "punycode": "^1.4.1" } }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -3809,6 +2854,23 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" }, + "v8-to-istanbul": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.0.1.tgz", + "integrity": "sha512-x0yZvZAkjJwdD3fPiJzYP37aod0ati4LlmD2RmpKjqewjKAov/u/ytZ8ViIZb07cN4cePKzl9ijiUi7C1LQ8hQ==", + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + } + } + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -3855,8 +2917,7 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "wide-align": { "version": "1.1.3", @@ -3946,8 +3007,7 @@ "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, "yallist": { "version": "2.1.2", diff --git a/package.json b/package.json index c82af6f7399..f7139fe4aac 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "tsc -p . && node scripts/copy-files.js", "watch": "tsc -w -p .", "clean": "rimraf ./dist", - "test": "nyc -r=lcov -r=text mocha \"dist/**/*.spec.js\"" + "test": "c8 mocha \"dist/**/*.spec.js\"" }, "keywords": [ "office 365", @@ -108,6 +108,7 @@ "dependencies": { "adal-node": "^0.2.1", "applicationinsights": "^1.5.0", + "c8": "^7.0.0", "easy-table": "^1.1.1", "node-forge": "^0.9.1", "omelette": "^0.4.12", @@ -133,14 +134,7 @@ "@types/xmldom": "^0.1.29", "coveralls": "^3.0.7", "mocha": "^6.2.1", - "nyc": "^13.3.0", "rimraf": "^3.0.0", "sinon": "^7.5.0" - }, - "nyc": { - "exclude": [ - "**/*.spec.js", - "**/clientsidepages.js" - ] } } diff --git a/src/Auth.ts b/src/Auth.ts index 8b3c912d8cc..93f1e8148f8 100644 --- a/src/Auth.ts +++ b/src/Auth.ts @@ -91,7 +91,6 @@ export class Auth { } public ensureAccessToken(resource: string, stdout: Logger, debug: boolean = false, fetchNew: boolean = false): Promise { - /* istanbul ignore next */ Logging.setLoggingOptions({ level: debug ? 3 : 0, log: (level: LoggingLevel, message: string, error?: Error): void => { @@ -347,7 +346,7 @@ export class Auth { public cancel(): void { if (this.userCodeInfo) { - this.authCtx.cancelRequestToGetTokenWithDeviceCode(this.userCodeInfo as UserCodeInfo, /* istanbul ignore next */(error: Error, response: TokenResponse | ErrorResponse): void => { }); + this.authCtx.cancelRequestToGetTokenWithDeviceCode(this.userCodeInfo as UserCodeInfo, (error: Error, response: TokenResponse | ErrorResponse): void => { }); } } diff --git a/src/Command.ts b/src/Command.ts index faf3985c41c..0a9c0076ef7 100644 --- a/src/Command.ts +++ b/src/Command.ts @@ -350,7 +350,6 @@ export default abstract class Command { const cmd = commandData.match; // required for tests not to fail. // Can't happen on runtime because we are already inside a command - /* istanbul ignore next */ if (!cmd) { return args; } diff --git a/src/Utils.spec.ts b/src/Utils.spec.ts index c17c93bea37..11f3914bf85 100644 --- a/src/Utils.spec.ts +++ b/src/Utils.spec.ts @@ -292,37 +292,37 @@ describe('Utils', () => { }); it('should get server relative path when https://contoso.sharepoint.com/sites/team1', () => { - const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com/sites/team1'); + const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com/sites/team1', ''); assert.equal(actual, '/sites/team1'); }); it('should get server relative path when https://contoso.sharepoint.com/sites/team1/', () => { - const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com/sites/team1/'); + const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com/sites/team1/', ''); assert.equal(actual, '/sites/team1'); }); it('should get server relative path when https://contoso.sharepoint.com/', () => { - const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com/'); + const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com/', ''); assert.equal(actual, '/'); }); it('should get server relative path when domain only', () => { - const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com'); + const actual = Utils.getServerRelativePath('https://contoso.sharepoint.com', ''); assert.equal(actual, '/'); }); it('should get server relative path when /sites/team1 relative path passed as param', () => { - const actual = Utils.getServerRelativePath('/sites/team1'); + const actual = Utils.getServerRelativePath('/sites/team1', ''); assert.equal(actual, '/sites/team1'); }); it('should get server relative path when /sites/team1/ relative path passed as param', () => { - const actual = Utils.getServerRelativePath('/sites/team1/'); + const actual = Utils.getServerRelativePath('/sites/team1/', ''); assert.equal(actual, '/sites/team1'); }); it('should get server relative path when / relative path passed as param', () => { - const actual = Utils.getServerRelativePath('/'); + const actual = Utils.getServerRelativePath('/', ''); assert.equal(actual, '/'); }); @@ -801,7 +801,7 @@ describe('Utils', () => { assert.equal(actual, 'Office 365 CLI Contoso'); }); - it('returns empty user name when access token is undefined available', () => { + it('returns empty user name when access token is undefined', () => { const actual = Utils.getUserNameFromAccessToken(undefined as any); assert.equal(actual, ''); }); @@ -811,6 +811,11 @@ describe('Utils', () => { assert.equal(actual, ''); }); + it('returns empty user name when invalid access token passed', () => { + const actual = Utils.getUserNameFromAccessToken('abc.def.ghi'); + assert.equal(actual, ''); + }); + it('isJavascriptReservedWord returns true if value equals a JavaScript Reserved Word (eg. onload)', () => { const result = Utils.isJavascriptReservedWord('onload'); assert.strictEqual(result, true); diff --git a/src/Utils.ts b/src/Utils.ts index 8575ece4cf3..1e08510451e 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -197,7 +197,7 @@ export default class Utils { * // returns "/sites/team1/Shared Documents" * Utils.getServerRelativePath("/sites/team1/", "/Shared Documents"); */ - public static getServerRelativePath(webUrl: string, folderRelativePath: string = ""): string { + public static getServerRelativePath(webUrl: string, folderRelativePath: string): string { const tenantUrl: string = `${url.parse(webUrl).protocol}//${url.parse(webUrl).hostname}`; let webRelativePath: string = webUrl.replace(tenantUrl, ''); diff --git a/src/autocomplete.spec.ts b/src/autocomplete.spec.ts index d3be9a68a10..f2efc4076a8 100644 --- a/src/autocomplete.spec.ts +++ b/src/autocomplete.spec.ts @@ -316,6 +316,26 @@ describe('autocomplete', () => { } }); + it('doesnt fail when the commands file is empty', () => { + Utils.restore(fs.existsSync); + sinon.stub(fs, 'existsSync').callsFake((path) => true); + const readFileSyncStub = sinon.stub(fs, 'readFileSync').callsFake((path, encoding) => ''); + (autocomplete as any).init(); + try { + assert.equal(JSON.stringify((autocomplete as any).commands), JSON.stringify({})); + } + catch (e) { + fail(e); + } + finally { + Utils.restore([ + fs.existsSync, + fs.readFileSync, + readFileSyncStub + ]); + } + }); + it('correctly lists available services when completing first fragment and it\'s empty', () => { const evtData = { before: "o365", diff --git a/src/config.spec.ts b/src/config.spec.ts new file mode 100644 index 00000000000..8eec8ffb4cf --- /dev/null +++ b/src/config.spec.ts @@ -0,0 +1,39 @@ +import * as assert from 'assert'; + +describe('Config', () => { + before(() => { + delete require.cache[require.resolve('./config')]; + }); + + afterEach(() => { + delete require.cache[require.resolve('./config')]; + }); + + it('returns process.env OFFICE365CLI_TENANT value', () => { + process.env.OFFICE365CLI_TENANT = 'tenant123'; + + const config = require('./config'); + assert.equal(config.default.tenant, 'tenant123'); + }); + + it('returns process.env OFFICE365CLI_AADAPPID value', () => { + process.env.OFFICE365CLI_AADAPPID = 'appId123'; + + const config = require('./config'); + assert.equal(config.default.cliAadAppId, 'appId123'); + }); + + it('returns default value since env OFFICE365CLI_TENANT not present', () => { + delete process.env.OFFICE365CLI_TENANT; + + const config = require('./config'); + assert.equal(config.default.tenant, 'common'); + }); + + it('returns default value since env OFFICE365CLI_AADAPPID not present', () => { + delete process.env.OFFICE365CLI_AADAPPID; + + const config = require('./config'); + assert.equal(config.default.cliAadAppId, '31359c7f-bd7e-475c-86db-fdb8c937548e'); + }); +}); \ No newline at end of file diff --git a/src/o365/base/AzmgmtItemsListCommand.ts b/src/o365/base/AzmgmtItemsListCommand.ts index 8b08bae5d71..77c95277a70 100644 --- a/src/o365/base/AzmgmtItemsListCommand.ts +++ b/src/o365/base/AzmgmtItemsListCommand.ts @@ -6,7 +6,6 @@ import * as url from 'url'; export abstract class AzmgmtItemsListCommand extends AzmgmtCommand { protected items: T[]; - /* istanbul ignore next */ constructor() { super(); this.items = []; diff --git a/src/o365/base/GraphItemsListCommand.ts b/src/o365/base/GraphItemsListCommand.ts index 4d3e7da3ae5..763deb37de9 100644 --- a/src/o365/base/GraphItemsListCommand.ts +++ b/src/o365/base/GraphItemsListCommand.ts @@ -5,7 +5,6 @@ import { GraphResponse } from './GraphResponse'; export abstract class GraphItemsListCommand extends GraphCommand { protected items: T[]; - /* istanbul ignore next */ constructor() { super(); this.items = []; diff --git a/src/o365/graph/commands/schemaextension/schemaextension-add.ts b/src/o365/graph/commands/schemaextension/schemaextension-add.ts index 1e6ae7ee7f7..54664ac85f1 100644 --- a/src/o365/graph/commands/schemaextension/schemaextension-add.ts +++ b/src/o365/graph/commands/schemaextension/schemaextension-add.ts @@ -122,29 +122,42 @@ class GraphSchemaExtensionAdd extends GraphCommand { } private validateProperties(propertiesString: string): boolean | string { + let result: boolean | string = false; + try { const properties: any = JSON.parse(propertiesString); // If the properties object is not an array if (properties.length === undefined) { - return 'The specified JSON string is not an array'; - } + + result = 'The specified JSON string is not an array'; - for (let i: number = 0; i < properties.length; i++) { - const property: any = properties[i]; - if (!property.name) { - return `Property ${JSON.stringify(property)} misses name`; - } - if (!this.isValidPropertyType(property.type)) { - return `${property.type} is not a valid property type. Valid types are: Binary, Boolean, DateTime, Integer and String`; + } else { + + for (let i: number = 0; i < properties.length; i++) { + const property: any = properties[i]; + if (!property.name) { + + result = `Property ${JSON.stringify(property)} misses name`; + + } + if (!this.isValidPropertyType(property.type)) { + + result = `${property.type} is not a valid property type. Valid types are: Binary, Boolean, DateTime, Integer and String`; + + } } - } - return true; + if(typeof result !== "string") { + result = true; + }; + } } catch (e) { - return e; + result = e; } + + return result; } private isValidPropertyType(propertyType: string): boolean { diff --git a/src/o365/spfx/commands/project/project-externalize.spec.ts b/src/o365/spfx/commands/project/project-externalize.spec.ts index af97b2e8c83..acdfbd4d761 100644 --- a/src/o365/spfx/commands/project/project-externalize.spec.ts +++ b/src/o365/spfx/commands/project/project-externalize.spec.ts @@ -19,6 +19,7 @@ describe(commands.PROJECT_EXTERNALIZE, () => { let trackEvent: any; let telemetry: any; const logEntryToCheck = 1; //necessary as long as we display the beta message + const projectPath: string = './src/o365/spfx/commands/project/project-externalize/test-projects/spfx-182-webpart-react'; before(() => { trackEvent = sinon.stub(appInsights, 'trackEvent').callsFake((t) => { @@ -296,6 +297,83 @@ describe(commands.PROJECT_EXTERNALIZE, () => { }); }); + it('determining project version doesn\'t fail if .yo-rc.json is empty', () => { + const originalExistsSync = fs.existsSync; + sinon.stub(fs, 'existsSync').callsFake((path: string) => { + if (path.endsWith('.yo-rc.json')) { + return true; + } + else { + return originalExistsSync(path); + } + }); + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('.yo-rc.json')) { + return ''; + } + else if (path.endsWith('package.json')) { + return `{ + "name": "spfx-141", + "version": "0.0.1", + "private": true, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "build": "gulp bundle", + "clean": "gulp clean", + "test": "gulp test" + }, + "dependencies": { + "@microsoft/sp-core-library": "~1.4.1", + "@microsoft/sp-webpart-base": "~1.4.1", + "@microsoft/sp-lodash-subset": "~1.4.1", + "@microsoft/sp-office-ui-fabric-core": "~1.4.1", + "@types/webpack-env": ">=1.12.1 <1.14.0" + }, + "devDependencies": { + "@microsoft/sp-build-web": "~1.4.1", + "@microsoft/sp-module-interfaces": "~1.4.1", + "@microsoft/sp-webpart-workbench": "~1.4.1", + "gulp": "~3.9.1", + "@types/chai": ">=3.4.34 <3.6.0", + "@types/mocha": ">=2.2.33 <2.6.0", + "ajv": "~5.2.2" + } + } + `; + } + else { + return originalReadFileSync(path); + } + }); + const getProjectVersionSpy = sinon.spy(command as any, 'getProjectVersion'); + + cmdInstance.action = command.action(); + cmdInstance.action({ options: { toVersion: '1.4.1' } }, (err?: any) => { + assert.strictEqual(getProjectVersionSpy.lastCall.returnValue, '1.4.1'); + }); + }); + + it('determining project version doesn\'t fail if package.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('package.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + const getProjectVersionSpy = sinon.spy(command as any, 'getProjectVersion'); + + cmdInstance.action = command.action(); + cmdInstance.action({ options: { toVersion: '1.4.1' } }, (err?: any) => { + assert.strictEqual(getProjectVersionSpy.lastCall.returnValue, undefined); + }); + }); + it('loads config.json when available', () => { const originalExistsSync = fs.existsSync; sinon.stub(fs, 'existsSync').callsFake((path: string) => { @@ -317,7 +395,7 @@ describe(commands.PROJECT_EXTERNALIZE, () => { }); const getProject = (command as any).getProject; - const project: Project = getProject('./'); + const project: Project = getProject(projectPath); assert.notEqual(typeof (project.configJson), 'undefined'); }); @@ -333,7 +411,7 @@ describe(commands.PROJECT_EXTERNALIZE, () => { }); const getProject = (command as any).getProject; - const project: Project = getProject('./'); + const project: Project = getProject(projectPath); assert.equal(typeof (project.packageJson), 'undefined'); }); @@ -349,10 +427,58 @@ describe(commands.PROJECT_EXTERNALIZE, () => { }); const getProject = (command as any).getProject; - const project: Project = getProject('./'); + const project: Project = getProject(projectPath); assert.equal(typeof (project.tsConfigJson), 'undefined'); }); + it('doesn\'t fail if config.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('config.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.configJson), 'undefined'); + }); + + it('doesn\'t fail if package.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('package.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.packageJson), 'undefined'); + }); + + it('doesn\'t fail if .yo-rc.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('.yo-rc.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.yoRcJson), 'undefined'); + }); + //#region findings it('e2e: shows correct number of findings for externalizing react web part 1.8.2 project', (done) => { diff --git a/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.spec.ts b/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.spec.ts index 84f853c22a7..41d67d4ad57 100644 --- a/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.spec.ts +++ b/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.spec.ts @@ -57,7 +57,34 @@ describe('DynamicRule', () => { assert.equal(findings.length, 1); }); - it('doesnt return anything is package is unsupported', async () => { + it('returns globalName if module type is script', async () => { + const project: Project = { + path: '/usr/tmp', + packageJson: { + dependencies: { + '@pnp/pnpjs': '1.3.5' + } + } + }; + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('@pnp/pnpjs/package.json')) { + return JSON.stringify({ + main: "./dist/pnpjs.es5.umd.bundle.js", + module: "./dist/pnpjs.es5.umd.bundle.min.js" + }); + } + else { + return originalReadFileSync(path); + } + }); + sinon.stub(request, 'head').callsFake(() => Promise.resolve()); + sinon.stub(request, 'post').callsFake(() => Promise.resolve({ scriptType: 'script' })); + const findings = await rule.visit(project); + assert.equal(findings.length, 1); + }); + + it('doesn\'t return anything is package is unsupported', async () => { const project: Project = { path: '/usr/tmp', packageJson: { @@ -161,4 +188,27 @@ describe('DynamicRule', () => { const findings = await rule.visit(project); assert.equal(findings.length, 0); }); + + it('doesn\'t return anything if package.json is empty', async () => { + const project: Project = { + path: '/usr/tmp', + packageJson: { + dependencies: { + '@pnp/pnpjs': '1.3.5' + } + } + }; + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('@pnp/pnpjs/package.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + sinon.stub(request, 'head').callsFake(() => Promise.resolve()); + const findings = await rule.visit(project); + assert.equal(findings.length, 0); + }); }); \ No newline at end of file diff --git a/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.ts b/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.ts index 777bb4fb379..9dbe8e911b9 100644 --- a/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.ts +++ b/src/o365/spfx/commands/project/project-externalize/rules/DynamicRule.ts @@ -8,102 +8,115 @@ export class DynamicRule extends BasicDependencyRule { private restrictedModules = ['react', 'react-dom', '@pnp/sp-clientsvc', '@pnp/sp-taxonomy']; private restrictedNamespaces = ['@types/', '@microsoft/']; - public async visit(project: Project): Promise { - if (!project.packageJson) { - return []; - } - - const validPackageNames: string[] = Object.getOwnPropertyNames(project.packageJson.dependencies) - .filter(x => this.restrictedNamespaces.map(y => x.indexOf(y) === -1).reduce((y, z) => y && z)) - .filter(x => this.restrictedModules.indexOf(x) === -1); + public visit(project: Project): Promise { + return new Promise((resolve: (result: ExternalizeEntry[]) => void, reject: (err: any) => void): void => { + if (!project.packageJson) { + return resolve([]); + } - return (await Promise.all(validPackageNames.map((x) => this.getExternalEntryForPackage(x, project)))) - .filter(x => x !== undefined) - .map(x => x as ExternalizeEntry); + const validPackageNames: string[] = Object.getOwnPropertyNames(project.packageJson.dependencies) + .filter(x => this.restrictedNamespaces.map(y => x.indexOf(y) === -1).reduce((y, z) => y && z)) + .filter(x => this.restrictedModules.indexOf(x) === -1); + + Promise + .all(validPackageNames.map((x) => this.getExternalEntryForPackage(x, project))) + .then((res: (ExternalizeEntry | undefined)[]): void => { + resolve(res + .filter(x => x !== undefined) + .map(x => x as ExternalizeEntry)); + }); + }); } - private async getExternalEntryForPackage(packageName: string, project: Project): Promise { - const version: string | undefined = project.packageJson && project.packageJson.dependencies[packageName]; - const filePath: string | undefined = this.cleanFilePath(this.getFilePath(packageName)); - - if (!version || !filePath) { - return undefined; - } - - let url: string = this.getFileUrl(packageName, version, filePath); - let testResult: boolean = await this.testUrl(url); + private getExternalEntryForPackage(packageName: string, project: Project): Promise { + return new Promise((resolve: (externalEntry: ExternalizeEntry | undefined) => void, reject: (err: any) => void): void => { + const version: string | undefined = project.packageJson && project.packageJson.dependencies[packageName]; + const filePath: string | undefined = this.cleanFilePath(this.getFilePath(packageName)); - if (!testResult) { - return undefined; - } - - if (!url.endsWith('.min.js')) { - const minUrl: string = url.replace('.js', '.min.js'); - const minResult: boolean = await this.testUrl(minUrl); - - if (minResult) { - url = minUrl; - testResult = true; + if (!version || !filePath) { + return resolve(undefined); } - } - - const moduleType = await this.getModuleType(url); - return { - key: packageName, - path: url, - globalName: moduleType === 'script' ? packageName : undefined, - } as ExternalizeEntry; + let url: string = `https://unpkg.com/${packageName}@${version}/${filePath}`; + let minUrl: string = url; + + this + .testUrl(url) + .then((): Promise => { + + if (!url.endsWith('.min.js')) { + minUrl = url.replace('.js', '.min.js'); + return this.testUrl(minUrl); + } + else { + return Promise.resolve(); + } + }) + .then((): Promise<'script' | 'module'> => { + url = minUrl; + + return this.getModuleType(url); + }) + .then((moduleType: 'script' | 'module'): void => { + resolve({ + key: packageName, + path: url, + globalName: moduleType === 'script' ? packageName : undefined, + } as ExternalizeEntry); + }, () => { + return resolve(undefined); + }); + }); } - private async getModuleType(url: string): Promise<'script' | 'module'> { - try { - const response = await request.post({ - url: 'https://scriptcheck-weu-fn.azurewebsites.net/api/script-check', - headers: { 'content-type': 'application/json', accept: 'application/json', 'x-anonymous': 'true' }, - body: JSON.stringify({ url: url }), - }); - - return JSON.parse(response).scriptType; - } - catch (error) { - return 'module'; - } + private getModuleType(url: string): Promise<'script' | 'module'> { + return new Promise<'script' | 'module'>((resolve: (scriptType: 'script' | 'module') => void, reject: (err: any) => void): void => { + request + .post<{ scriptType: 'script' | 'module' }>({ + url: 'https://scriptcheck-weu-fn.azurewebsites.net/api/script-check', + headers: { 'content-type': 'application/json', accept: 'application/json', 'x-anonymous': 'true' }, + body: { url: url }, + json: true + }) + .then((res: { scriptType: 'script' | 'module' }): void => { + resolve(res.scriptType); + }, (): void => { + resolve('module'); + }); + }); } - private getFileUrl(packageName: string, version: string, filePath: string) { - return `https://unpkg.com/${packageName}@${version}/${filePath}`; - } - - private async testUrl(url: string): Promise { - try { - await request.head({ url: url, headers: { 'x-anonymous': 'true' } }); - return true; - } - catch { - return false; - } + private testUrl(url: string): Promise { + return new Promise((resolve: () => void, reject: () => void): void => { + request + .head({ url: url, headers: { 'x-anonymous': 'true' } }) + .then(() => { + return resolve(); + }, () => { + return reject(); + }); + }); } private getFilePath(packageName: string): string | undefined { + let result: string | undefined = undefined; + const packageJsonFilePath: string = `node_modules/${packageName}/package.json`; try { const packageJson: { module?: any, main?: any } = JSON.parse(fs.readFileSync(packageJsonFilePath, 'utf8')); if (packageJson.module) { - return packageJson.module; + result = packageJson.module; } else if (packageJson.main) { - return packageJson.main; + result = packageJson.main; } - else { - return undefined; - } - } - catch { // file doesn't exist, giving up - return undefined; + } catch { + // file doesn't exist, giving up } + + return result; } private cleanFilePath(filePath: string | undefined): string | undefined { diff --git a/src/o365/spfx/commands/project/project-upgrade.spec.ts b/src/o365/spfx/commands/project/project-upgrade.spec.ts index 8790b3b2cce..d9284fc0bd0 100644 --- a/src/o365/spfx/commands/project/project-upgrade.spec.ts +++ b/src/o365/spfx/commands/project/project-upgrade.spec.ts @@ -259,6 +259,83 @@ describe(commands.PROJECT_UPGRADE, () => { }); }); + it('determining project version doesn\'t fail if .yo-rc.json is empty', () => { + const originalExistsSync = fs.existsSync; + sinon.stub(fs, 'existsSync').callsFake((path: string) => { + if (path.endsWith('.yo-rc.json')) { + return true; + } + else { + return originalExistsSync(path); + } + }); + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('.yo-rc.json')) { + return ''; + } + else if (path.endsWith('package.json')) { + return `{ + "name": "spfx-141", + "version": "0.0.1", + "private": true, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "build": "gulp bundle", + "clean": "gulp clean", + "test": "gulp test" + }, + "dependencies": { + "@microsoft/sp-core-library": "~1.4.1", + "@microsoft/sp-webpart-base": "~1.4.1", + "@microsoft/sp-lodash-subset": "~1.4.1", + "@microsoft/sp-office-ui-fabric-core": "~1.4.1", + "@types/webpack-env": ">=1.12.1 <1.14.0" + }, + "devDependencies": { + "@microsoft/sp-build-web": "~1.4.1", + "@microsoft/sp-module-interfaces": "~1.4.1", + "@microsoft/sp-webpart-workbench": "~1.4.1", + "gulp": "~3.9.1", + "@types/chai": ">=3.4.34 <3.6.0", + "@types/mocha": ">=2.2.33 <2.6.0", + "ajv": "~5.2.2" + } + } + `; + } + else { + return originalReadFileSync(path); + } + }); + const getProjectVersionSpy = sinon.spy(command as any, 'getProjectVersion'); + + cmdInstance.action = command.action(); + cmdInstance.action({ options: { toVersion: '1.4.1' } }, (err?: any) => { + assert.strictEqual(getProjectVersionSpy.lastCall.returnValue, '1.4.1'); + }); + }); + + it('determining project version doesn\'t fail if package.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('package.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + const getProjectVersionSpy = sinon.spy(command as any, 'getProjectVersion'); + + cmdInstance.action = command.action(); + cmdInstance.action({ options: { toVersion: '1.4.1' } }, (err?: any) => { + assert.strictEqual(getProjectVersionSpy.lastCall.returnValue, undefined); + }); + }); + it('shows error if the current project version is not supported by the CLI', () => { sinon.stub(command as any, 'getProjectVersion').callsFake(_ => '0.0.1'); @@ -346,6 +423,175 @@ describe(commands.PROJECT_UPGRADE, () => { assert.equal(typeof (project.tsConfigJson), 'undefined'); }); + it('doesn\'t fail if config.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('config.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.configJson), 'undefined'); + }); + + it('doesn\'t fail if copy-assets.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('copy-assets.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.copyAssetsJson), 'undefined'); + }); + + it('doesn\'t fail if deploy-azure-storage.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('deploy-azure-storage.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.deployAzureStorageJson), 'undefined'); + }); + + it('doesn\'t fail if package.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('package.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.packageJson), 'undefined'); + }); + + it('doesn\'t fail if package-solution.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('package-solution.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.packageSolutionJson), 'undefined'); + }); + + it('doesn\'t fail if serve.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('serve.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.serveJson), 'undefined'); + }); + + it('doesn\'t fail if tslint.json is empty', () => { + const originalExistsSync = fs.existsSync; + sinon.stub(fs, 'existsSync').callsFake((path: string) => { + if (path.endsWith('tslint.json')) { + return true; + } + else { + return originalExistsSync(path); + } + }); + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('tslint.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.tsLintJson), 'undefined'); + }); + + it('doesn\'t fail if write-manifests.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('write-manifests.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.writeManifestsJson), 'undefined'); + }); + + it('doesn\'t fail if .yo-rc.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('.yo-rc.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof (project.yoRcJson), 'undefined'); + }); + + it('doesn\'t fail if extensions.json is empty', () => { + const originalReadFileSync = fs.readFileSync; + sinon.stub(fs, 'readFileSync').callsFake((path: string) => { + if (path.endsWith('extensions.json')) { + return ''; + } + else { + return originalReadFileSync(path); + } + }); + + const getProject = (command as any).getProject; + const project: Project = getProject(projectPath); + assert.equal(typeof ((project.vsCode as VsCode).extensionsJson), 'undefined'); + }); + it('loads manifests when available', () => { assert.equal((project141webPartNoLib.manifests as Manifest[]).length, 1); }); @@ -564,7 +810,7 @@ describe(commands.PROJECT_UPGRADE, () => { cmdInstance.action = command.action(); cmdInstance.action({ options: { toVersion: '1.0.1', output: 'json' } }, (err?: any) => { (command as any).supportedVersions.splice(1, 1); - assert.equal(JSON.stringify(err), JSON.stringify(new CommandError("Cannot find module './project-upgrade/upgrade-0'"))); + assert(JSON.stringify(err).indexOf("Cannot find module './project-upgrade/upgrade-0'") > -1); }); }); diff --git a/src/o365/spfx/commands/project/project-upgrade/model/ScssFile.spec.ts b/src/o365/spfx/commands/project/project-upgrade/model/ScssFile.spec.ts new file mode 100644 index 00000000000..0dd10d19e6f --- /dev/null +++ b/src/o365/spfx/commands/project/project-upgrade/model/ScssFile.spec.ts @@ -0,0 +1,17 @@ +import * as assert from 'assert'; +import * as fs from 'fs'; +import Utils from '../../../../../../Utils'; +import { ScssFile } from './ScssFile'; + +describe('ScssFile', () => { + afterEach(() => { + Utils.restore([ + fs.readFileSync + ]); + }); + + it('doesn\'t fail when reading file contents fails', () => { + const scssFile = new ScssFile('file.scss'); + assert.strictEqual(scssFile.source, undefined); + }); +}); \ No newline at end of file diff --git a/src/o365/spfx/commands/project/project-upgrade/model/TsFile.spec.ts b/src/o365/spfx/commands/project/project-upgrade/model/TsFile.spec.ts index 06f78485530..807c135ae07 100644 --- a/src/o365/spfx/commands/project/project-upgrade/model/TsFile.spec.ts +++ b/src/o365/spfx/commands/project/project-upgrade/model/TsFile.spec.ts @@ -3,6 +3,7 @@ import * as fs from 'fs'; import * as sinon from 'sinon'; import { TsFile } from "."; import Utils from '../../../../../../Utils'; +import * as ts from 'typescript'; describe('TsFile', () => { let tsFile: TsFile; @@ -12,7 +13,11 @@ describe('TsFile', () => { }); afterEach(() => { - Utils.restore(fs.existsSync); + Utils.restore([ + fs.existsSync, + ts.createSourceFile + ]); + (tsFile as any)._source = undefined; }); it('doesn\'t throw exception if the specified file doesn\'t exist', () => { @@ -35,4 +40,10 @@ describe('TsFile', () => { sinon.stub(fs, 'existsSync').callsFake(() => false); assert.equal(tsFile.nodes, undefined); }); + + it('doesn\'t fail when creating TS file fails', () => { + (tsFile as any)._source = '123'; + sinon.stub(ts, 'createSourceFile').callsFake(() => { throw new Error('An exception has occurred'); }) + assert.equal(tsFile.sourceFile, undefined); + }); }); \ No newline at end of file diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001001_DEP_microsoft_sp_core_library.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001001_DEP_microsoft_sp_core_library.ts index 7fa96a5d697..f6be6fc3b1d 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001001_DEP_microsoft_sp_core_library.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001001_DEP_microsoft_sp_core_library.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001001_DEP_microsoft_sp_core_library extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-core-library', packageVersion, false); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001002_DEP_microsoft_sp_lodash_subset.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001002_DEP_microsoft_sp_lodash_subset.ts index c99e3326010..37a95959dae 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001002_DEP_microsoft_sp_lodash_subset.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001002_DEP_microsoft_sp_lodash_subset.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001002_DEP_microsoft_sp_lodash_subset extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-lodash-subset', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.ts index 0718fa39305..4ea5cc00ac7 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001003_DEP_microsoft_sp_office_ui_fabric_core.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001003_DEP_microsoft_sp_office_ui_fabric_core extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-office-ui-fabric-core', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001004_DEP_microsoft_sp_webpart_base.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001004_DEP_microsoft_sp_webpart_base.ts index 8e717c640d3..6d53dd072a1 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001004_DEP_microsoft_sp_webpart_base.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001004_DEP_microsoft_sp_webpart_base.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001004_DEP_microsoft_sp_webpart_base extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-webpart-base', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001005_DEP_types_react.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001005_DEP_types_react.ts index 00403fde35e..495c015ec93 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001005_DEP_types_react.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001005_DEP_types_react.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001005_DEP_types_react extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/react', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001006_DEP_types_react_dom.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001006_DEP_types_react_dom.ts index fb08c3ffdfa..b480cd8b6c8 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001006_DEP_types_react_dom.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001006_DEP_types_react_dom.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001006_DEP_types_react_dom extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/react-dom', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001007_DEP_types_webpack_env.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001007_DEP_types_webpack_env.ts index afb577089e0..591d67e95bb 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001007_DEP_types_webpack_env.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001007_DEP_types_webpack_env.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001007_DEP_types_webpack_env extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/webpack-env', packageVersion); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001008_DEP_react.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001008_DEP_react.ts index 2b17774d36b..41e23de4608 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001008_DEP_react.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001008_DEP_react.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001008_DEP_react extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('react', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001009_DEP_react_dom.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001009_DEP_react_dom.ts index 341a106b512..7b1cb368ca3 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001009_DEP_react_dom.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001009_DEP_react_dom.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001009_DEP_react_dom extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('react-dom', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001010_DEP_types_es6_promise.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001010_DEP_types_es6_promise.ts index 6910217d308..8e41f47bde5 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001010_DEP_types_es6_promise.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001010_DEP_types_es6_promise.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001010_DEP_types_es6_promise extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/es6-promise', packageVersion); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001011_DEP_microsoft_sp_dialog.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001011_DEP_microsoft_sp_dialog.ts index ee1e8d5774a..2097001cdfa 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001011_DEP_microsoft_sp_dialog.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001011_DEP_microsoft_sp_dialog.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001011_DEP_microsoft_sp_dialog extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-dialog', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001012_DEP_microsoft_sp_application_base.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001012_DEP_microsoft_sp_application_base.ts index ebd1f5f763a..22bb77b8468 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001012_DEP_microsoft_sp_application_base.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001012_DEP_microsoft_sp_application_base.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001012_DEP_microsoft_sp_application_base extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-application-base', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001013_DEP_microsoft_decorators.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001013_DEP_microsoft_decorators.ts index 1c785e157d6..b8ec72bf5a5 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001013_DEP_microsoft_decorators.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001013_DEP_microsoft_decorators.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001013_DEP_microsoft_decorators extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/decorators', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001014_DEP_microsoft_sp_listview_extensibility.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001014_DEP_microsoft_sp_listview_extensibility.ts index 3614b710d9b..7b97c0da236 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001014_DEP_microsoft_sp_listview_extensibility.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001014_DEP_microsoft_sp_listview_extensibility.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001014_DEP_microsoft_sp_listview_extensibility extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-listview-extensibility', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001015_DEP_types_react_addons_shallow_compare.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001015_DEP_types_react_addons_shallow_compare.ts index 12316192b51..2adabc51025 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001015_DEP_types_react_addons_shallow_compare.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001015_DEP_types_react_addons_shallow_compare.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001015_DEP_types_react_addons_shallow_compare extends DependencyRule { constructor(packageVersion: string, add: boolean) { - /* istanbul ignore next */ super('@types/react-addons-shallow-compare', packageVersion, false, true, add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001016_DEP_types_react_addons_update.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001016_DEP_types_react_addons_update.ts index 7b8f6af856e..4ec4969c9f1 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001016_DEP_types_react_addons_update.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001016_DEP_types_react_addons_update.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001016_DEP_types_react_addons_update extends DependencyRule { constructor(packageVersion: string, add: boolean) { - /* istanbul ignore next */ super('@types/react-addons-update', packageVersion, false, true, add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001017_DEP_types_react_addons_update.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001017_DEP_types_react_addons_update.ts index 87f9cc6642f..498d2fd8ce8 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001017_DEP_types_react_addons_update.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001017_DEP_types_react_addons_update.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001017_DEP_types_react_addons_test_utils extends DependencyRule { constructor(packageVersion: string, add: boolean) { - /* istanbul ignore next */ super('@types/react-addons-test-utils', packageVersion, false, true, add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001018_DEP_microsoft_sp_client_base.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001018_DEP_microsoft_sp_client_base.ts index 916dd15a67c..b34af050049 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001018_DEP_microsoft_sp_client_base.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001018_DEP_microsoft_sp_client_base.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001018_DEP_microsoft_sp_client_base extends DependencyRule { constructor(packageVersion: string, add: boolean) { - /* istanbul ignore next */ super('@microsoft/sp-client-base', packageVersion, false, true, add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001019_DEP_knockout.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001019_DEP_knockout.ts index 0c755a80be3..c76a6fe2c97 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001019_DEP_knockout.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001019_DEP_knockout.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001019_DEP_knockout extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('knockout', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001020_DEP_types_knockout.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001020_DEP_types_knockout.ts index 6ed8e012754..9a863efbb0c 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001020_DEP_types_knockout.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001020_DEP_types_knockout.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001020_DEP_types_knockout extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/knockout', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001021_DEP_microsoft_sp_property_pane.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001021_DEP_microsoft_sp_property_pane.ts index 2d232c1aedf..c31cd5b033e 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001021_DEP_microsoft_sp_property_pane.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001021_DEP_microsoft_sp_property_pane.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN001021_DEP_microsoft_sp_property_pane extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-property-pane', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.ts index dba80c0432f..534c2b83d90 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.ts @@ -4,7 +4,6 @@ import { Utils } from "../"; export class FN001022_DEP_office_ui_fabric_react extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('office-ui-fabric-react', packageVersion, false, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002001_DEVDEP_microsoft_sp_build_web.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002001_DEVDEP_microsoft_sp_build_web.ts index cf90184d16f..5e2cc1715cc 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002001_DEVDEP_microsoft_sp_build_web.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002001_DEVDEP_microsoft_sp_build_web.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002001_DEVDEP_microsoft_sp_build_web extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-build-web', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.ts index 4d208392590..7c1889f5583 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002002_DEVDEP_microsoft_sp_module_interfaces.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002002_DEVDEP_microsoft_sp_module_interfaces extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-module-interfaces', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002003_DEVDEP_microsoft_sp_webpart_workbench.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002003_DEVDEP_microsoft_sp_webpart_workbench.ts index 9770700c979..486bdbe2bd6 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002003_DEVDEP_microsoft_sp_webpart_workbench.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002003_DEVDEP_microsoft_sp_webpart_workbench.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002003_DEVDEP_microsoft_sp_webpart_workbench extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-webpart-workbench', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002004_DEVDEP_gulp.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002004_DEVDEP_gulp.ts index 33bc0ab8749..da513fa1301 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002004_DEVDEP_gulp.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002004_DEVDEP_gulp.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002004_DEVDEP_gulp extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('gulp', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002005_DEVDEP_types_chai.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002005_DEVDEP_types_chai.ts index b205f60472e..b627de58cbe 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002005_DEVDEP_types_chai.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002005_DEVDEP_types_chai.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002005_DEVDEP_types_chai extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/chai', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002006_DEVDEP_types_mocha.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002006_DEVDEP_types_mocha.ts index eb7af49090e..3d332f66cec 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002006_DEVDEP_types_mocha.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002006_DEVDEP_types_mocha.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002006_DEVDEP_types_mocha extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/mocha', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002007_DEVDEP_ajv.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002007_DEVDEP_ajv.ts index 537988a6fe8..382af44f0f4 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002007_DEVDEP_ajv.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002007_DEVDEP_ajv.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002007_DEVDEP_ajv extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('ajv', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002008_DEVDEP_tslint_microsoft_contrib.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002008_DEVDEP_tslint_microsoft_contrib.ts index e323c6c007e..25920d66afa 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002008_DEVDEP_tslint_microsoft_contrib.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002008_DEVDEP_tslint_microsoft_contrib.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002008_DEVDEP_tslint_microsoft_contrib extends DependencyRule { constructor(packageVersion: string, add: boolean = true) { - /* istanbul ignore next */ super('tslint-microsoft-contrib', packageVersion, true, false, add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002009_DEVDEP_microsoft_sp_tslint_rules.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002009_DEVDEP_microsoft_sp_tslint_rules.ts index 4d4795a259a..6416ab54a72 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002009_DEVDEP_microsoft_sp_tslint_rules.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002009_DEVDEP_microsoft_sp_tslint_rules.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002009_DEVDEP_microsoft_sp_tslint_rules extends DependencyRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@microsoft/sp-tslint-rules', packageVersion, true); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002010_DEVDEP_microsoft_rush_stack_compiler_2_7.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002010_DEVDEP_microsoft_rush_stack_compiler_2_7.ts index 72ebbd38a44..176aef33b0f 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002010_DEVDEP_microsoft_rush_stack_compiler_2_7.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002010_DEVDEP_microsoft_rush_stack_compiler_2_7.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002010_DEVDEP_microsoft_rush_stack_compiler_2_7 extends DependencyRule { constructor(packageVersion: string, add: boolean = true) { - /* istanbul ignore next */ super('@microsoft/rush-stack-compiler-2.7', packageVersion, true, false, add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN002011_DEVDEP_microsoft_rush_stack_compiler_2_9.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN002011_DEVDEP_microsoft_rush_stack_compiler_2_9.ts index aa589a09f3c..9879f92dd85 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN002011_DEVDEP_microsoft_rush_stack_compiler_2_9.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN002011_DEVDEP_microsoft_rush_stack_compiler_2_9.ts @@ -2,7 +2,6 @@ import { DependencyRule } from "./DependencyRule"; export class FN002011_DEVDEP_microsoft_rush_stack_compiler_2_9 extends DependencyRule { constructor(packageVersion: string, isOptional: boolean = true) { - /* istanbul ignore next */ super('@microsoft/rush-stack-compiler-2.9', packageVersion, true, isOptional); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN003003_CFG_bundles.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN003003_CFG_bundles.ts index 500c252f271..23b1306cf9e 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN003003_CFG_bundles.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN003003_CFG_bundles.ts @@ -64,14 +64,10 @@ export class FN003003_CFG_bundles extends Rule { */ private tryGetBundleName(entry: string, index: number): string { let name: string = index.toString(); - try { - name = entry.substring(entry.lastIndexOf('/') + 1, entry.length); - name = name.replace('.js', ''); - name = name.replace(/([a-z](?=[A-Z]))/g, '$1-'); - name = name.toLowerCase(); - } - catch { - } + name = entry.substring(entry.lastIndexOf('/') + 1, entry.length); + name = name.replace('.js', ''); + name = name.replace(/([a-z](?=[A-Z]))/g, '$1-'); + name = name.toLowerCase(); return name; } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011001_MAN_webpart_schema.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011001_MAN_webpart_schema.ts index 6273f9a1e7a..db2a09aead3 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011001_MAN_webpart_schema.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011001_MAN_webpart_schema.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011001_MAN_webpart_schema extends ManifestRule { constructor(private schema: string) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011002_MAN_applicationCustomizer_schema.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011002_MAN_applicationCustomizer_schema.ts index e960cdae5f7..bb08d7805a6 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011002_MAN_applicationCustomizer_schema.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011002_MAN_applicationCustomizer_schema.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011002_MAN_applicationCustomizer_schema extends ManifestRule { constructor(private schema: string) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011003_MAN_listViewCommandSet_schema.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011003_MAN_listViewCommandSet_schema.ts index 32a72c47d1c..7358f0dc5f2 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011003_MAN_listViewCommandSet_schema.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011003_MAN_listViewCommandSet_schema.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011003_MAN_listViewCommandSet_schema extends ManifestRule { constructor(private schema: string) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011004_MAN_fieldCustomizer_schema.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011004_MAN_fieldCustomizer_schema.ts index 8ebbefd4736..28962f579b0 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011004_MAN_fieldCustomizer_schema.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011004_MAN_fieldCustomizer_schema.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011004_MAN_fieldCustomizer_schema extends ManifestRule { constructor(private schema: string) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011005_MAN_webpart_defaultGroup.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011005_MAN_webpart_defaultGroup.ts index dfc3040fd70..6cd61dee0a2 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011005_MAN_webpart_defaultGroup.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011005_MAN_webpart_defaultGroup.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011005_MAN_webpart_defaultGroup extends ManifestRule { constructor(private oldDefaultGroup: string, private newDefaultGroup: string) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011009_MAN_webpart_safeWithCustomScriptDisabled.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011009_MAN_webpart_safeWithCustomScriptDisabled.ts index ecfe940e066..421cd670e6c 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011009_MAN_webpart_safeWithCustomScriptDisabled.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011009_MAN_webpart_safeWithCustomScriptDisabled.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011009_MAN_webpart_safeWithCustomScriptDisabled extends ManifestRule { constructor(private add: boolean) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN011011_MAN_webpart_supportedHosts.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN011011_MAN_webpart_supportedHosts.ts index e5197a4d957..2743474bddf 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN011011_MAN_webpart_supportedHosts.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN011011_MAN_webpart_supportedHosts.ts @@ -4,7 +4,7 @@ import { ManifestRule } from "./ManifestRule"; export class FN011011_MAN_webpart_supportedHosts extends ManifestRule { constructor(private add: boolean) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN015001_FILE_typings_tsd_d_ts.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN015001_FILE_typings_tsd_d_ts.ts index 8d79b1179fd..c5b0b0dd27a 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN015001_FILE_typings_tsd_d_ts.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN015001_FILE_typings_tsd_d_ts.ts @@ -2,7 +2,6 @@ import { FileAddRemoveRule } from "./FileAddRemoveRule"; export class FN015001_FILE_typings_tsd_d_ts extends FileAddRemoveRule { constructor(add: boolean) { - /* istanbul ignore next */ super('./typings/tsd.d.ts', add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN015002_FILE_typings__ms_odsp_d_ts.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN015002_FILE_typings__ms_odsp_d_ts.ts index a2bc1158dc0..bdfb33c8e97 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN015002_FILE_typings__ms_odsp_d_ts.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN015002_FILE_typings__ms_odsp_d_ts.ts @@ -2,7 +2,6 @@ import { FileAddRemoveRule } from "./FileAddRemoveRule"; export class FN015002_FILE_typings__ms_odsp_d_ts extends FileAddRemoveRule { constructor(add: boolean) { - /* istanbul ignore next */ super('./typings/@ms/odsp.d.ts', add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN015003_FILE_tslint_json.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN015003_FILE_tslint_json.ts index 3eb4fb1c678..ed1a57641f7 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN015003_FILE_tslint_json.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN015003_FILE_tslint_json.ts @@ -2,7 +2,6 @@ import { FileAddRemoveRule } from "./FileAddRemoveRule"; export class FN015003_FILE_tslint_json extends FileAddRemoveRule { constructor(add: boolean, contents: string) { - /* istanbul ignore next */ super('./tslint.json', add, contents); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN015004_FILE_config_tslint_json.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN015004_FILE_config_tslint_json.ts index 4985c7c5c0c..256c0752259 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN015004_FILE_config_tslint_json.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN015004_FILE_config_tslint_json.ts @@ -2,7 +2,6 @@ import { FileAddRemoveRule } from "./FileAddRemoveRule"; export class FN015004_FILE_config_tslint_json extends FileAddRemoveRule { constructor(add: boolean) { - /* istanbul ignore next */ super('./config/tslint.json', add); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN015005_FILE_src_index_ts.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN015005_FILE_src_index_ts.ts index fc897cdcf11..7e74cd7779a 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN015005_FILE_src_index_ts.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN015005_FILE_src_index_ts.ts @@ -2,7 +2,6 @@ import { FileAddRemoveRule } from "./FileAddRemoveRule"; export class FN015005_FILE_src_index_ts extends FileAddRemoveRule { constructor(add: boolean, contents: string) { - /* istanbul ignore next */ super('./src/index.ts', add, contents); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN016001_TS_msgraphclient_packageName.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN016001_TS_msgraphclient_packageName.ts index 55f375260ac..df136868f1d 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN016001_TS_msgraphclient_packageName.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN016001_TS_msgraphclient_packageName.ts @@ -5,7 +5,7 @@ import * as ts from 'typescript'; export class FN016001_TS_msgraphclient_packageName extends TsRule { constructor(private packageName: string) { - super()/* istanbul ignore next */; + super(); } get id(): string { diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN016002_TS_msgraphclient_instance.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN016002_TS_msgraphclient_instance.ts index 760a57ae610..1e17aaf2aad 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN016002_TS_msgraphclient_instance.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN016002_TS_msgraphclient_instance.ts @@ -5,7 +5,6 @@ import * as ts from 'typescript'; export class FN016002_TS_msgraphclient_instance extends TsRule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN016003_TS_aadhttpclient_instance.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN016003_TS_aadhttpclient_instance.ts index 5bea412bcc8..9b79b723b54 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN016003_TS_aadhttpclient_instance.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN016003_TS_aadhttpclient_instance.ts @@ -5,7 +5,6 @@ import * as ts from 'typescript'; export class FN016003_TS_aadhttpclient_instance extends TsRule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN016004_TS_property_pane_property_import.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN016004_TS_property_pane_property_import.ts index 75327874d4b..cf0b56a8ac5 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN016004_TS_property_pane_property_import.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN016004_TS_property_pane_property_import.ts @@ -5,7 +5,6 @@ import * as ts from 'typescript'; export class FN016004_TS_property_pane_property_import extends TsRule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN017001_MISC_npm_dedupe.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN017001_MISC_npm_dedupe.ts index 583ecc20b13..be69b6cf2e5 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN017001_MISC_npm_dedupe.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN017001_MISC_npm_dedupe.ts @@ -4,7 +4,6 @@ import { Rule } from "./Rule"; export class FN017001_MISC_npm_dedupe extends Rule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN018001_TEAMS_folder.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN018001_TEAMS_folder.ts index 67bd024735b..6e416a96d85 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN018001_TEAMS_folder.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN018001_TEAMS_folder.ts @@ -6,7 +6,6 @@ import * as fs from 'fs'; export class FN018001_TEAMS_folder extends Rule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN018002_TEAMS_manifest.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN018002_TEAMS_manifest.ts index 440c8555eff..c850c121f65 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN018002_TEAMS_manifest.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN018002_TEAMS_manifest.ts @@ -6,7 +6,6 @@ import * as fs from 'fs'; export class FN018002_TEAMS_manifest extends Rule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN018003_TEAMS_tab20x20_png.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN018003_TEAMS_tab20x20_png.ts index 6b1a696ab84..ac5e4fc19a6 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN018003_TEAMS_tab20x20_png.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN018003_TEAMS_tab20x20_png.ts @@ -6,7 +6,6 @@ import * as fs from 'fs'; export class FN018003_TEAMS_tab20x20_png extends Rule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN018004_TEAMS_tab96x96_png.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN018004_TEAMS_tab96x96_png.ts index ebb25ebb9e4..02aa467a3a2 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN018004_TEAMS_tab96x96_png.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN018004_TEAMS_tab96x96_png.ts @@ -6,7 +6,6 @@ import * as fs from 'fs'; export class FN018004_TEAMS_tab96x96_png extends Rule { constructor() { - /* istanbul ignore next */ super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN020001_RES_types_react.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN020001_RES_types_react.ts index 43b29cef942..41ce3ddc60d 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN020001_RES_types_react.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN020001_RES_types_react.ts @@ -4,7 +4,6 @@ import { ResolutionRule } from "./ResolutionRule"; export class FN020001_RES_types_react extends ResolutionRule { constructor(packageVersion: string) { - /* istanbul ignore next */ super('@types/react', packageVersion); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN021001_PKG_main.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN021001_PKG_main.ts index 1828421e585..af6ea8f2c04 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN021001_PKG_main.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN021001_PKG_main.ts @@ -2,7 +2,6 @@ import { PackageRule } from "./PackageRule"; export class FN021001_PKG_main extends PackageRule { constructor(add: boolean, propertyValue?: string) { - /* istanbul ignore next */ super('main', add, propertyValue); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN022001_SCSS_remove_fabric_react.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN022001_SCSS_remove_fabric_react.ts index 7147bb996e4..e025d6c2442 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN022001_SCSS_remove_fabric_react.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN022001_SCSS_remove_fabric_react.ts @@ -4,7 +4,6 @@ import { ScssRule } from "./ScssRule"; import { Occurrence, Utils } from "../"; export class FN022001_SCSS_remove_fabric_react extends ScssRule { - /* istanbul ignore next */ constructor(private importValue: string) { super(); } diff --git a/src/o365/spfx/commands/project/project-upgrade/rules/FN022002_SCSS_add_fabric_react.ts b/src/o365/spfx/commands/project/project-upgrade/rules/FN022002_SCSS_add_fabric_react.ts index 241048e4e19..5bbdf1a930d 100644 --- a/src/o365/spfx/commands/project/project-upgrade/rules/FN022002_SCSS_add_fabric_react.ts +++ b/src/o365/spfx/commands/project/project-upgrade/rules/FN022002_SCSS_add_fabric_react.ts @@ -4,7 +4,6 @@ import { ScssRule } from "./ScssRule"; import { Occurrence, Utils } from "../"; export class FN022002_SCSS_add_fabric_react extends ScssRule { - /* istanbul ignore next */ constructor(private importValue: string) { super(); } diff --git a/src/o365/spo/commands/apppage/apppage-set.ts b/src/o365/spo/commands/apppage/apppage-set.ts index ffdecee973a..efcb558da03 100644 --- a/src/o365/spo/commands/apppage/apppage-set.ts +++ b/src/o365/spo/commands/apppage/apppage-set.ts @@ -36,7 +36,7 @@ class SpoAppPageSetCommand extends SpoCommand { }, json: true, body: { - serverRelativeUrl: `${Utils.getServerRelativePath(args.options.webUrl)}/SitePages/${args.options.pageName}`, + serverRelativeUrl: `${Utils.getServerRelativePath(args.options.webUrl, '')}/SitePages/${args.options.pageName}`, webPartDataAsJson: args.options.webPartData } }; diff --git a/src/o365/spo/commands/contenttype/contenttype-field-set.ts b/src/o365/spo/commands/contenttype/contenttype-field-set.ts index 4d376f391ea..3c0a47f8754 100644 --- a/src/o365/spo/commands/contenttype/contenttype-field-set.ts +++ b/src/o365/spo/commands/contenttype/contenttype-field-set.ts @@ -34,7 +34,7 @@ class SpoContentTypeFieldSetCommand extends SpoCommand { private fieldLink: FieldLink | null; constructor() { - super()/* istanbul ignore next */; + super(); this.requestDigest = ''; this.siteId = ''; this.webId = ''; diff --git a/src/o365/spo/commands/hubsite/hubsite-list.spec.ts b/src/o365/spo/commands/hubsite/hubsite-list.spec.ts index a83d8928ef9..7b24d33fff8 100644 --- a/src/o365/spo/commands/hubsite/hubsite-list.spec.ts +++ b/src/o365/spo/commands/hubsite/hubsite-list.spec.ts @@ -16,7 +16,7 @@ describe(commands.HUBSITE_LIST, () => { before(() => { sinon.stub(auth, 'restoreAuth').callsFake(() => Promise.resolve()); - sinon.stub(appInsights, 'trackEvent').callsFake(() => {}); + sinon.stub(appInsights, 'trackEvent').callsFake(() => { }); auth.service.connected = true; auth.service.spoUrl = 'https://contoso.sharepoint.com'; }); @@ -627,21 +627,21 @@ describe(commands.HUBSITE_LIST, () => { if (opts.url.indexOf('?Paged=TRUE') == -1) { firstPagedRequest = true; return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 1, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, HierarchyHasIndention: null, LastRow: 3, NextHref: "?Paged=TRUE&p_Title=Another%20Hub%20Sub%202&p_ID=32&PageFirstRow=4&View=00000000-0000-0000-0000-00000000000", - Row: [{"ID":"30","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F30%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"554","Title":"Another Hub Root","SiteUrl":"https://bloemium.sharepoint.com/sites/AnotherHubRoot","SiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","HubSiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","TimeDeleted":"","State":"","State.":""},{"ID":"31","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F31%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"556","Title":"Another Hub Sub 1","SiteUrl":"https://bloemium.sharepoint.com/sites/AnotherHubSub1","SiteId":"{3A569D44-D3CD-45AB-9AB8-87675D18AF63}","HubSiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","TimeDeleted":"","State":"","State.":""},{"ID":"32","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F32%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"556","Title":"Another Hub Sub 2","SiteUrl":"https://bloemium.sharepoint.com/sites/AnotherHubSub2","SiteId":"{794FE8EC-458F-444B-A799-E179AB786784}","HubSiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","TimeDeleted":"","State":"","State.":""}], + Row: [{ "ID": "30", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F30%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "554", "Title": "Another Hub Root", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubRoot", "SiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "31", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F31%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "556", "Title": "Another Hub Sub 1", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubSub1", "SiteId": "{3A569D44-D3CD-45AB-9AB8-87675D18AF63}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "32", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F32%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "556", "Title": "Another Hub Sub 2", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubSub2", "SiteId": "{794FE8EC-458F-444B-A799-E179AB786784}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }], RowLimit: 3 }); } if (opts.url.indexOf('?Paged=TRUE&p_Title=Another%20Hub%20Sub%202&p_ID=32&PageFirstRow=4&View=00000000-0000-0000-0000-00000000000') > -1) { secondPagedRequest = true return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 4, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, @@ -649,21 +649,21 @@ describe(commands.HUBSITE_LIST, () => { LastRow: 6, NextHref: "?Paged=TRUE&p_Title=Hub%20sub%204&p_ID=29&PageFirstRow=7&View=00000000-0000-0000-0000-00000000000", PrevHref: "?&&p_Title=Hub%20sub%201&&PageFirstRow=1&View=00000000-0000-0000-0000-000000000000", - Row: [{"ID":"25","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F25%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"518","Title":"Hub sub 1","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsub1","SiteId":"{83C2E5B0-DC64-4040-AB1F-A6A9A8169E46}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""},{"ID":"28","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F28%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"550","Title":"Hub sub 3","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsub3","SiteId":"{5509F9AC-ECF8-488A-B960-BEDF4D8FB321}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""},{"ID":"29","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F29%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"518","Title":"Hub sub 4","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsub4","SiteId":"{8AC9E1ED-29B8-4342-AF30-11F597731F8A}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""}], + Row: [{ "ID": "25", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F25%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "518", "Title": "Hub sub 1", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsub1", "SiteId": "{83C2E5B0-DC64-4040-AB1F-A6A9A8169E46}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "28", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F28%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "550", "Title": "Hub sub 3", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsub3", "SiteId": "{5509F9AC-ECF8-488A-B960-BEDF4D8FB321}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "29", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F29%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "518", "Title": "Hub sub 4", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsub4", "SiteId": "{8AC9E1ED-29B8-4342-AF30-11F597731F8A}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }], RowLimit: 3 }); - } + } if (opts.url.indexOf('?Paged=TRUE&p_Title=Hub%20sub%204&p_ID=29&PageFirstRow=7&View=00000000-0000-0000-0000-00000000000') > -1) { thirdPagedRequest = true; return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 7, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, HierarchyHasIndention: null, LastRow: 8, PrevHref: "?Paged=TRUE&PagedPrev=TRUE&p_Title=Hub%20sub%20x&p_ID=27&PageFirstRow=4&View=00000000-0000-0000-0000-000000000000", - Row: [{"ID":"27","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F27%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"550","Title":"Hub sub x","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsubx","SiteId":"{DC0D0D79-1B0D-45A7-A8EE-7B97679B79DE}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""},{"ID":"24","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F24%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"514","Title":"Root Hub","SiteUrl":"https://bloemium.sharepoint.com/sites/RootHub","SiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""}], + Row: [{ "ID": "27", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F27%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "550", "Title": "Hub sub x", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsubx", "SiteId": "{DC0D0D79-1B0D-45A7-A8EE-7B97679B79DE}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "24", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F24%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "514", "Title": "Root Hub", "SiteUrl": "https://bloemium.sharepoint.com/sites/RootHub", "SiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }], RowLimit: 3 }); } @@ -682,7 +682,7 @@ describe(commands.HUBSITE_LIST, () => { }); }); - it('corrrectly retrieves the associated sites in batches (debug)', (done) => { + it('correctly retrieves the associated sites in batches (debug)', (done) => { // Cast the command class instance to any so we can set the private // property 'batchSize' to a small number for easier testing const newBatchSize = 3; @@ -720,21 +720,21 @@ describe(commands.HUBSITE_LIST, () => { if (opts.url.indexOf('?Paged=TRUE') == -1) { firstPagedRequest = true; return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 1, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, HierarchyHasIndention: null, LastRow: 3, NextHref: "?Paged=TRUE&p_Title=Another%20Hub%20Sub%202&p_ID=32&PageFirstRow=4&View=00000000-0000-0000-0000-00000000000", - Row: [{"ID":"30","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F30%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"554","Title":"Another Hub Root","SiteUrl":"https://bloemium.sharepoint.com/sites/AnotherHubRoot","SiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","HubSiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","TimeDeleted":"","State":"","State.":""},{"ID":"31","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F31%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"556","Title":"Another Hub Sub 1","SiteUrl":"https://bloemium.sharepoint.com/sites/AnotherHubSub1","SiteId":"{3A569D44-D3CD-45AB-9AB8-87675D18AF63}","HubSiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","TimeDeleted":"","State":"","State.":""},{"ID":"32","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F32%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"556","Title":"Another Hub Sub 2","SiteUrl":"https://bloemium.sharepoint.com/sites/AnotherHubSub2","SiteId":"{794FE8EC-458F-444B-A799-E179AB786784}","HubSiteId":"{E9E2090B-1F51-47EA-8466-75D5A244217E}","TimeDeleted":"","State":"","State.":""}], + Row: [{ "ID": "30", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F30%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "554", "Title": "Another Hub Root", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubRoot", "SiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "31", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F31%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "556", "Title": "Another Hub Sub 1", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubSub1", "SiteId": "{3A569D44-D3CD-45AB-9AB8-87675D18AF63}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "32", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F32%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "556", "Title": "Another Hub Sub 2", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubSub2", "SiteId": "{794FE8EC-458F-444B-A799-E179AB786784}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }], RowLimit: 3 }); } if (opts.url.indexOf('?Paged=TRUE&p_Title=Another%20Hub%20Sub%202&p_ID=32&PageFirstRow=4&View=00000000-0000-0000-0000-00000000000') > -1) { secondPagedRequest = true return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 4, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, @@ -742,21 +742,21 @@ describe(commands.HUBSITE_LIST, () => { LastRow: 6, NextHref: "?Paged=TRUE&p_Title=Hub%20sub%204&p_ID=29&PageFirstRow=7&View=00000000-0000-0000-0000-00000000000", PrevHref: "?&&p_Title=Hub%20sub%201&&PageFirstRow=1&View=00000000-0000-0000-0000-000000000000", - Row: [{"ID":"25","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F25%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"518","Title":"Hub sub 1","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsub1","SiteId":"{83C2E5B0-DC64-4040-AB1F-A6A9A8169E46}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""},{"ID":"28","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F28%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"550","Title":"Hub sub 3","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsub3","SiteId":"{5509F9AC-ECF8-488A-B960-BEDF4D8FB321}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""},{"ID":"29","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F29%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"518","Title":"Hub sub 4","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsub4","SiteId":"{8AC9E1ED-29B8-4342-AF30-11F597731F8A}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""}], + Row: [{ "ID": "25", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F25%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/25_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "518", "Title": "Hub sub 1", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsub1", "SiteId": "{83C2E5B0-DC64-4040-AB1F-A6A9A8169E46}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "28", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F28%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/28_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "550", "Title": "Hub sub 3", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsub3", "SiteId": "{5509F9AC-ECF8-488A-B960-BEDF4D8FB321}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "29", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F29%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/29_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "518", "Title": "Hub sub 4", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsub4", "SiteId": "{8AC9E1ED-29B8-4342-AF30-11F597731F8A}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }], RowLimit: 3 }); - } + } if (opts.url.indexOf('?Paged=TRUE&p_Title=Hub%20sub%204&p_ID=29&PageFirstRow=7&View=00000000-0000-0000-0000-00000000000') > -1) { thirdPagedRequest = true; return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 7, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, HierarchyHasIndention: null, LastRow: 8, PrevHref: "?Paged=TRUE&PagedPrev=TRUE&p_Title=Hub%20sub%20x&p_ID=27&PageFirstRow=4&View=00000000-0000-0000-0000-000000000000", - Row: [{"ID":"27","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F27%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"550","Title":"Hub sub x","SiteUrl":"https://bloemium.sharepoint.com/sites/Hubsubx","SiteId":"{DC0D0D79-1B0D-45A7-A8EE-7B97679B79DE}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""},{"ID":"24","PermMask":"0x7fffffffffffffff","FSObjType":"0","ContentTypeId":"0x0100F14AFE642BCF6347882B6B8ABA3E15E3","FileRef":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000","FileRef.urlencode":"%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F24%5F%2E000","FileRef.urlencodeasurl":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000","FileRef.urlencoding":"/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000","ItemChildCount":"0","FolderChildCount":"0","SMTotalSize":"514","Title":"Root Hub","SiteUrl":"https://bloemium.sharepoint.com/sites/RootHub","SiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","HubSiteId":"{77F50C57-C40A-4666-83F5-D325567512BE}","TimeDeleted":"","State":"","State.":""}], + Row: [{ "ID": "27", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F27%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/27_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "550", "Title": "Hub sub x", "SiteUrl": "https://bloemium.sharepoint.com/sites/Hubsubx", "SiteId": "{DC0D0D79-1B0D-45A7-A8EE-7B97679B79DE}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "24", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F24%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/24_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "514", "Title": "Root Hub", "SiteUrl": "https://bloemium.sharepoint.com/sites/RootHub", "SiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "HubSiteId": "{77F50C57-C40A-4666-83F5-D325567512BE}", "TimeDeleted": "", "State": "", "State.": "" }], RowLimit: 3 }); } @@ -811,7 +811,7 @@ describe(commands.HUBSITE_LIST, () => { if (opts.url.indexOf('?Paged=TRUE') == -1) { firstPagedRequest = true; return Promise.resolve({ - FilterLink : "?", + FilterLink: "?", FirstRow: 1, FolderPermissions: "0x7fffffffffffffff", ForceNoHierarchy: 1, @@ -836,7 +836,7 @@ describe(commands.HUBSITE_LIST, () => { }); }); - it('correctly handles OData error when retrieving available site designs', (done) => { + it('correctly handles OData error when retrieving hub sites', (done) => { sinon.stub(request, 'get').callsFake((opts) => { return Promise.reject({ error: { 'odata.error': { message: { value: 'An error has occurred' } } } }); }); @@ -852,6 +852,113 @@ describe(commands.HUBSITE_LIST, () => { }); }); + it('correctly handles error in the first batch of associated sites', (done) => { + // Cast the command class instance to any so we can set the private + // property 'batchSize' to a small number for easier testing + const newBatchSize = 3; + (command as any).batchSize = newBatchSize; + sinon.stub(request, 'get').resolves({ + value: [ + { + "Description": null, + "ID": "389d0d83-40bb-40ad-b92a-534b7cb37d0b", + "LogoUrl": "http://contoso.com/__siteIcon__.jpg", + "SiteId": "389d0d83-40bb-40ad-b92a-534b7cb37d0b", + "SiteUrl": "https://contoso.sharepoint.com/sites/Sales", + "Targets": null, + "TenantInstanceId": "00000000-0000-0000-0000-000000000000", + "Title": "Sales" + }, + { + "Description": null, + "ID": "b2c94ca1-0957-4bdd-b549-b7d365edc10f", + "LogoUrl": "http://contoso.com/__siteIcon__.jpg", + "SiteId": "b2c94ca1-0957-4bdd-b549-b7d365edc10f", + "SiteUrl": "https://contoso.sharepoint.com/sites/travelprograms", + "Targets": null, + "TenantInstanceId": "00000000-0000-0000-0000-000000000000", + "Title": "Travel Programs" + } + ] + }); + sinon.stub(request, 'post').callsFake(() => { + return Promise.reject('An error has occurred'); + }); + cmdInstance.action({ options: { debug: false, includeAssociatedSites: true, output: 'json' } }, (err?: any) => { + try { + assert.equal(JSON.stringify(err), JSON.stringify(new CommandError('An error has occurred'))); + done(); + } + catch (e) { + done(e); + } + }); + }); + + it('correctly handles error in a subsequent batch of associated sites', (done) => { + // Cast the command class instance to any so we can set the private + // property 'batchSize' to a small number for easier testing + const newBatchSize = 3; + (command as any).batchSize = newBatchSize; + sinon.stub(request, 'get').resolves({ + value: [ + { + "Description": null, + "ID": "389d0d83-40bb-40ad-b92a-534b7cb37d0b", + "LogoUrl": "http://contoso.com/__siteIcon__.jpg", + "SiteId": "389d0d83-40bb-40ad-b92a-534b7cb37d0b", + "SiteUrl": "https://contoso.sharepoint.com/sites/Sales", + "Targets": null, + "TenantInstanceId": "00000000-0000-0000-0000-000000000000", + "Title": "Sales" + }, + { + "Description": null, + "ID": "b2c94ca1-0957-4bdd-b549-b7d365edc10f", + "LogoUrl": "http://contoso.com/__siteIcon__.jpg", + "SiteId": "b2c94ca1-0957-4bdd-b549-b7d365edc10f", + "SiteUrl": "https://contoso.sharepoint.com/sites/travelprograms", + "Targets": null, + "TenantInstanceId": "00000000-0000-0000-0000-000000000000", + "Title": "Travel Programs" + } + ] + }); + sinon.stub(request, 'post').callsFake((opts) => { + if (opts.url.indexOf(`/_api/web/lists/GetByTitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS')/RenderListDataAsStream`) > -1 + && opts.body.parameters.ViewXml.indexOf('' + newBatchSize + '') > -1) { + if (opts.url.indexOf('?Paged=TRUE') == -1) { + return Promise.resolve({ + FilterLink: "?", + FirstRow: 1, + FolderPermissions: "0x7fffffffffffffff", + ForceNoHierarchy: 1, + HierarchyHasIndention: null, + LastRow: 3, + NextHref: "?Paged=TRUE&p_Title=Another%20Hub%20Sub%202&p_ID=32&PageFirstRow=4&View=00000000-0000-0000-0000-00000000000", + Row: [{ "ID": "30", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F30%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/30_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "554", "Title": "Another Hub Root", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubRoot", "SiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "31", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F31%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/31_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "556", "Title": "Another Hub Sub 1", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubSub1", "SiteId": "{3A569D44-D3CD-45AB-9AB8-87675D18AF63}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }, { "ID": "32", "PermMask": "0x7fffffffffffffff", "FSObjType": "0", "ContentTypeId": "0x0100F14AFE642BCF6347882B6B8ABA3E15E3", "FileRef": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "FileRef.urlencode": "%2FLists%2FDO%5FNOT%5FDELETE%5FSPLIST%5FTENANTADMIN%5FAGGREGATED%5FSITECO%2F32%5F%2E000", "FileRef.urlencodeasurl": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "FileRef.urlencoding": "/Lists/DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECO/32_.000", "ItemChildCount": "0", "FolderChildCount": "0", "SMTotalSize": "556", "Title": "Another Hub Sub 2", "SiteUrl": "https://bloemium.sharepoint.com/sites/AnotherHubSub2", "SiteId": "{794FE8EC-458F-444B-A799-E179AB786784}", "HubSiteId": "{E9E2090B-1F51-47EA-8466-75D5A244217E}", "TimeDeleted": "", "State": "", "State.": "" }], + RowLimit: 3 + }); + } + if (opts.url.indexOf('?Paged=TRUE&p_Title=Another%20Hub%20Sub%202&p_ID=32&PageFirstRow=4&View=00000000-0000-0000-0000-00000000000') > -1) { + return Promise.reject('An error has occurred'); + } + + return Promise.reject('Invalid request'); + } + return Promise.reject('Invalid request'); + }); + cmdInstance.action({ options: { debug: true, includeAssociatedSites: true, output: 'json' } }, (err?: any) => { + try { + assert.equal(JSON.stringify(err), JSON.stringify(new CommandError('An error has occurred'))); + done(); + } + catch (e) { + done(e); + } + }); + }); + it('supports debug mode', () => { const options = (command.options() as CommandOption[]); let containsOption = false; diff --git a/src/o365/spo/commands/hubsite/hubsite-list.ts b/src/o365/spo/commands/hubsite/hubsite-list.ts index 1f76550958c..3df755d9f29 100644 --- a/src/o365/spo/commands/hubsite/hubsite-list.ts +++ b/src/o365/spo/commands/hubsite/hubsite-list.ts @@ -29,7 +29,7 @@ class SpoHubSiteListCommand extends SpoCommand { } constructor() { - super()/* istanbul ignore next */; + super(); this.batchSize = 30; } @@ -85,37 +85,11 @@ class SpoHubSiteListCommand extends SpoCommand { } }; - if (this.debug || this.verbose) { + if (this.debug) { cmd.log(`Will retrieve associated sites (including the hub sites) in batches of ${this.batchSize}`); } - const getSites = async (reqOptions: any, nonPagedUrl: string, sites: AssociatedSite[] = [], batchNumber: number = 0): Promise => { - const res: QueryListResult = await request.post(requestOptions); - batchNumber++; - const retrievedSites: AssociatedSite[] = res.Row.length > 0 ? sites.concat(res.Row) : sites; - - if (this.debug || this.verbose) { - cmd.log(res); - cmd.log(`Retrieved ${res.Row.length} sites in batch ${batchNumber}`); - } - - if (!!res.NextHref) { - reqOptions.url = nonPagedUrl + res.NextHref; - if (this.debug) { - cmd.log(`Url for next batch of sites: ${reqOptions.url}`); - } - - return getSites(reqOptions, nonPagedUrl, retrievedSites, batchNumber); - } - else { - if (this.debug || this.verbose) { - cmd.log(`Retrieved ${retrievedSites.length} sites in total`); - } - return retrievedSites; - } - } - - return getSites(requestOptions, requestOptions.url); + return this.getSites(requestOptions, requestOptions.url, cmd); }) .then((res: AssociatedSite[] | void): void => { if (res) { @@ -157,6 +131,46 @@ class SpoHubSiteListCommand extends SpoCommand { }, (err: any): void => this.handleRejectedODataJsonPromise(err, cmd, cb)); } + private getSites(reqOptions: any, nonPagedUrl: string, cmd: CommandInstance, sites: AssociatedSite[] = [], batchNumber: number = 0): Promise { + return new Promise((resolve: (associatedSites: AssociatedSite[]) => void, reject: (error: any) => void): void => { + request + .post(reqOptions) + .then((res: QueryListResult): void => { + batchNumber++; + const retrievedSites: AssociatedSite[] = res.Row.length > 0 ? sites.concat(res.Row) : sites; + + if (this.debug) { + cmd.log(res); + cmd.log(`Retrieved ${res.Row.length} sites in batch ${batchNumber}`); + } + + if (!!res.NextHref) { + reqOptions.url = nonPagedUrl + res.NextHref; + if (this.debug) { + cmd.log(`Url for next batch of sites: ${reqOptions.url}`); + } + + this + .getSites(reqOptions, nonPagedUrl, cmd, retrievedSites, batchNumber) + .then((associatedSites: AssociatedSite[]): void => { + resolve(associatedSites); + }, (err: any): void => { + reject(err); + }); + } + else { + if (this.debug) { + cmd.log(`Retrieved ${retrievedSites.length} sites in total`); + } + + resolve(retrievedSites); + } + }, (err: any): void => { + reject(err); + }); + }); + } + public options(): CommandOption[] { const options: CommandOption[] = [ { diff --git a/src/o365/spo/commands/listitem/listitem-add.ts b/src/o365/spo/commands/listitem/listitem-add.ts index 46e1bb702b0..017a2c1bb42 100644 --- a/src/o365/spo/commands/listitem/listitem-add.ts +++ b/src/o365/spo/commands/listitem/listitem-add.ts @@ -126,7 +126,7 @@ class SpoListItemAddCommand extends SpoCommand { return request .get(requestOptions) .then(rootFolderResponse => { - targetFolderServerRelativeUrl = Utils.getServerRelativePath(rootFolderResponse["ServerRelativeUrl"], args.options.folder); + targetFolderServerRelativeUrl = Utils.getServerRelativePath(rootFolderResponse["ServerRelativeUrl"], args.options.folder as string); return folderExtensions.ensureFolder(args.options.webUrl, targetFolderServerRelativeUrl); }); diff --git a/src/o365/spo/commands/page/page-clientsidewebpart-add.spec.ts b/src/o365/spo/commands/page/page-clientsidewebpart-add.spec.ts index 41773265164..77f325a6081 100644 --- a/src/o365/spo/commands/page/page-clientsidewebpart-add.spec.ts +++ b/src/o365/spo/commands/page/page-clientsidewebpart-add.spec.ts @@ -3088,6 +3088,18 @@ describe(commands.PAGE_CLIENTSIDEWEBPART_ADD, () => { assert.notEqual(actual, true); }); + it('passes validation when webPartProperties value is valid JSON', () => { + const actual = (command.validate() as CommandValidate)({ + options: { + pageName: 'page.aspx', + webUrl: 'https://contoso.sharepoint.com', + webPartId: '3ede60d3-dc2c-438b-b5bf-cc40bb2351e1', + webPartProperties: '{}' + } + }); + assert.equal(actual, true); + }); + it('fails validation if webPartData value is not valid JSON', () => { const actual = (command.validate() as CommandValidate)({ options: { @@ -3100,6 +3112,18 @@ describe(commands.PAGE_CLIENTSIDEWEBPART_ADD, () => { assert.notEqual(actual, true); }); + it('passes validation when webPartData value is valid JSON', () => { + const actual = (command.validate() as CommandValidate)({ + options: { + pageName: 'page.aspx', + webUrl: 'https://contoso.sharepoint.com', + webPartId: '3ede60d3-dc2c-438b-b5bf-cc40bb2351e1', + webPartData: '{}' + } + }); + assert.equal(actual, true); + }); + it('fails validation if standardWebPart is not valid', () => { const actual = (command.validate() as CommandValidate)({ options: { pageName: 'page.aspx', webUrl: 'https://contoso.sharepoint.com', standardWebPart: 'Foo' } diff --git a/src/o365/spo/commands/page/page-clientsidewebpart-add.ts b/src/o365/spo/commands/page/page-clientsidewebpart-add.ts index a91f167716c..5f540215274 100644 --- a/src/o365/spo/commands/page/page-clientsidewebpart-add.ts +++ b/src/o365/spo/commands/page/page-clientsidewebpart-add.ts @@ -112,7 +112,7 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand { if (canvasContent.length === 1) { const defaultSection: Control = { position: { - controlIndex:1, + controlIndex: 1, sectionIndex: 1, zoneIndex: 1, sectionFactor: 12, @@ -120,7 +120,7 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand { }, emphasis: {}, displayMode: 2 - }; + }; canvasContent.unshift(defaultSection); } @@ -331,12 +331,9 @@ class SpoPageClientSideWebPartAddCommand extends SpoCommand { cmd.log(''); } - try { - const webPartData = JSON.parse(args.options.webPartData); - (webPart as any).webPartData = this.extend((webPart as any).webPartData, webPartData); - webPart.id = (webPart as any).webPartData.instanceId; - } - catch { } + const webPartData = JSON.parse(args.options.webPartData); + (webPart as any).webPartData = this.extend((webPart as any).webPartData, webPartData); + webPart.id = (webPart as any).webPartData.instanceId; } } diff --git a/src/o365/spo/commands/propertybag/propertybag-base.ts b/src/o365/spo/commands/propertybag/propertybag-base.ts index 7184d8324f3..eeeb0090d73 100644 --- a/src/o365/spo/commands/propertybag/propertybag-base.ts +++ b/src/o365/spo/commands/propertybag/propertybag-base.ts @@ -18,7 +18,6 @@ export abstract class SpoPropertyBagBaseCommand extends SpoCommand { */ protected formDigestValue: string; - /* istanbul ignore next */ constructor() { super(); this.formDigestValue = ''; diff --git a/src/o365/spo/commands/term/term-add.spec.ts b/src/o365/spo/commands/term/term-add.spec.ts index 258cd1a50af..cbcc244b2dc 100644 --- a/src/o365/spo/commands/term/term-add.spec.ts +++ b/src/o365/spo/commands/term/term-add.spec.ts @@ -704,6 +704,16 @@ describe(commands.TERM_ADD, () => { assert.equal(actual, true); }); + it('passes validation when custom properties is a valid JSON string', () => { + const actual = (command.validate() as CommandValidate)({ options: { name: 'IT', termGroupName: 'People', termSetName: 'Department', customProperties: '{}' } }); + assert.equal(actual, true); + }); + + it('passes validation when local custom properties is a valid JSON string', () => { + const actual = (command.validate() as CommandValidate)({ options: { name: 'IT', termGroupName: 'People', termSetName: 'Department', localCustomProperties: '{}' } }); + assert.equal(actual, true); + }); + it('supports debug mode', () => { const options = (command.options() as CommandOption[]); let containsOption = false; diff --git a/src/o365/spo/commands/term/term-set-add.spec.ts b/src/o365/spo/commands/term/term-set-add.spec.ts index 785be8d6212..8a5e2d39439 100644 --- a/src/o365/spo/commands/term/term-set-add.spec.ts +++ b/src/o365/spo/commands/term/term-set-add.spec.ts @@ -993,6 +993,11 @@ describe(commands.TERM_SET_ADD, () => { assert.equal(actual, true); }); + it('passes validation when custom properties is a valid JSON string', () => { + const actual = (command.validate() as CommandValidate)({ options: { name: 'PnP-Organizations', termGroupName: 'PnPTermSets', customProperties: '{}' } }); + assert.equal(actual, true); + }); + it('supports debug mode', () => { const options = (command.options() as CommandOption[]); let containsOption = false; diff --git a/src/o365/spo/commands/theme/theme-get.ts b/src/o365/spo/commands/theme/theme-get.ts index 5e09c59aed0..8435705a040 100644 --- a/src/o365/spo/commands/theme/theme-get.ts +++ b/src/o365/spo/commands/theme/theme-get.ts @@ -63,7 +63,8 @@ class SpoThemeGetCommand extends SpoCommand { return Promise.resolve(json); }) .then((json: any): void => { - const { _ObjectType_, ...theme } = json[6]; + const theme = json[6]; + delete theme._ObjectType_; cmd.log(theme); if (this.verbose) { diff --git a/src/o365/spo/commands/web/web-reindex.ts b/src/o365/spo/commands/web/web-reindex.ts index 7a0128ebe50..7113db7aa67 100644 --- a/src/o365/spo/commands/web/web-reindex.ts +++ b/src/o365/spo/commands/web/web-reindex.ts @@ -24,7 +24,7 @@ class SpoWebReindexCommand extends SpoCommand { private reindexedLists: boolean; constructor() { - super()/* istanbul ignore next */; + super(); this.reindexedLists = false; } diff --git a/src/o365/yammer/commands/message/message-list.ts b/src/o365/yammer/commands/message/message-list.ts index 0358129e39e..9e8b862d267 100644 --- a/src/o365/yammer/commands/message/message-list.ts +++ b/src/o365/yammer/commands/message/message-list.ts @@ -25,7 +25,6 @@ class YammerMessageListCommand extends YammerCommand { private items: any[]; private static readonly feedTypes: string[] = ['All', 'Top', 'My', 'Following', 'Sent', 'Private', 'Received']; - /* istanbul ignore next */ constructor() { super(); this.items = []; diff --git a/src/o365/yammer/commands/user/user-list.ts b/src/o365/yammer/commands/user/user-list.ts index 6813e38c7d0..832372f216c 100644 --- a/src/o365/yammer/commands/user/user-list.ts +++ b/src/o365/yammer/commands/user/user-list.ts @@ -23,7 +23,6 @@ interface Options extends GlobalOptions { class YammerUserListCommand extends YammerCommand { protected items: any[]; - /* istanbul ignore next */ constructor() { super(); this.items = []; diff --git a/tsconfig.json b/tsconfig.json index 0f5ae696c0b..d2f73b7f502 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es2015", "module": "commonjs", "lib": ["es2015", "dom"], "sourceMap": true,