From bf21d8e9a54ec6c8ae4fd2f109158ff27b8d07da Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 08:52:54 +0100 Subject: [PATCH 01/19] Migration --- .travis.yml | 2 +- LICENSE | 26 ++----------------- NOTICE | 6 +++++ bin/mocks-server | 10 +++++++ index.js | 10 +++++++ lib/Cli.js | 10 +++++++ lib/Server.js | 10 +++++++ lib/Settings.js | 10 +++++++ lib/api/Api.js | 10 +++++++ lib/api/Features.js | 10 +++++++ lib/api/Settings.js | 10 +++++++ lib/base-cli/Inquirer.js | 10 +++++++ lib/base-cli/index.js | 10 +++++++ lib/common/constants.js | 10 +++++++ lib/common/helpers.js | 10 +++++++ lib/common/options.js | 10 +++++++ lib/common/tracer.js | 10 +++++++ lib/features/Feature.js | 10 +++++++ lib/features/Features.js | 10 +++++++ lib/middlewares.js | 10 +++++++ lib/start.js | 10 +++++++ package-lock.json | 2 +- package.json | 6 ++--- sonar-project.properties | 11 +++++--- test/acceptance/cli/autocomplete.spec.js | 10 +++++++ test/acceptance/cli/custom-quit.spec.js | 10 +++++++ test/acceptance/cli/exit-logs-mode.spec.js | 10 +++++++ test/acceptance/cli/fixtures/autocomplete.js | 10 +++++++ .../cli/fixtures/custom-quit-method.js | 10 +++++++ .../acceptance/cli/fixtures/exit-logs-mode.js | 10 +++++++ test/acceptance/cli/fixtures/logs-mode.js | 10 +++++++ .../acceptance/cli/fixtures/readme-example.js | 10 +++++++ .../cli/fixtures/remove-listeners.js | 10 +++++++ test/acceptance/cli/logs-mode.spec.js | 10 +++++++ test/acceptance/cli/readme-example.spec.js | 10 +++++++ test/acceptance/cli/remove-listeners.spec.js | 10 +++++++ test/acceptance/mocks-server-bin.spec.js | 10 +++++++ test/unit/api/Api.mocks.js | 10 +++++++ test/unit/api/Api.spec.js | 10 +++++++ test/unit/api/Features.mocks.js | 10 +++++++ test/unit/api/Features.spec.js | 10 +++++++ test/unit/api/Settings.mocks.js | 10 +++++++ test/unit/api/Settings.spec.js | 10 +++++++ test/unit/cli/Inquirer.spec.js | 10 +++++++ test/unit/common/Libs.mocks.js | 10 +++++++ test/unit/common/options.spec.js | 10 +++++++ test/unit/common/tracer.spec.js | 10 +++++++ test/unit/features/Feature.spec.js | 10 +++++++ test/unit/features/Features.mocks.js | 10 +++++++ test/unit/features/Features.spec.js | 10 +++++++ test/unit/index.spec.js | 10 +++++++ test/unit/lib/BaseCli.mocks.js | 10 +++++++ test/unit/lib/Cli.mocks.js | 10 +++++++ test/unit/lib/Cli.spec.js | 10 +++++++ test/unit/lib/Server.mocks.js | 10 +++++++ test/unit/lib/Server.spec.js | 10 +++++++ test/unit/lib/Settings.mocks.js | 10 +++++++ test/unit/lib/Settings.spec.js | 10 +++++++ test/unit/lib/helpers.spec.js | 10 +++++++ test/unit/lib/middlewares.spec.js | 10 +++++++ test/unit/lib/start.spec.js | 10 +++++++ test/utils/CliRunner.js | 10 +++++++ test/utils/index.js | 10 +++++++ 63 files changed, 591 insertions(+), 32 deletions(-) create mode 100644 NOTICE diff --git a/.travis.yml b/.travis.yml index 1ba948597..559e143dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ script: deploy: provider: npm - email: "devops@xbyorange.com" + email: "javier.brea@gmail.com" api_key: "$NPM_TOKEN" on: tags: true diff --git a/LICENSE b/LICENSE index 261eeb9e9..b43ac6227 100644 --- a/LICENSE +++ b/LICENSE @@ -175,27 +175,5 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + Copyright 2019 Javier Brea + Copyright 2019 XbyOrange diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000..7ca6ecdd3 --- /dev/null +++ b/NOTICE @@ -0,0 +1,6 @@ +mocks-server. Main distribution +Copyright 2019 Javier Brea + +Portions of this software were developed at XbyOrange company. + XByOrange npm-file-link v1.0.1, distributed under The Apache Software License, Version 2.0. + Github repository "xbyorange/mocks-server" (https://github.com/XbyOrange/mocks-server), branch master, commit 961ca6702569091ed863679a8e675788c6f4fded. The original project files were wrongly licensed because an error of the main maintainer, Javier Brea, who received instructions from the XbyOrange company about licensing it as Apache2.0, but didn't include the appropiate license header in all repository files by error. The error has been fixed and license headers has been added to all original files, as it was the real intention of the XbyOrange company. diff --git a/bin/mocks-server b/bin/mocks-server index 40ef927c5..95c063c15 100755 --- a/bin/mocks-server +++ b/bin/mocks-server @@ -2,3 +2,13 @@ "use strict"; require("../lib/start").start(); + +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ diff --git a/index.js b/index.js index d02f5959d..2b35dfbc1 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const Cli = require("./lib/Cli"); diff --git a/lib/Cli.js b/lib/Cli.js index 62ec24d0e..2e1856351 100644 --- a/lib/Cli.js +++ b/lib/Cli.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const chalk = require("chalk"); diff --git a/lib/Server.js b/lib/Server.js index c924bd668..256741fc5 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const path = require("path"); diff --git a/lib/Settings.js b/lib/Settings.js index 375a5888d..555182d8b 100644 --- a/lib/Settings.js +++ b/lib/Settings.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; class Settings { diff --git a/lib/api/Api.js b/lib/api/Api.js index 242253375..dcc768cda 100644 --- a/lib/api/Api.js +++ b/lib/api/Api.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const express = require("express"); diff --git a/lib/api/Features.js b/lib/api/Features.js index 943e6b02a..28bd8b234 100644 --- a/lib/api/Features.js +++ b/lib/api/Features.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const express = require("express"); diff --git a/lib/api/Settings.js b/lib/api/Settings.js index d4296577c..71fa3c3e0 100644 --- a/lib/api/Settings.js +++ b/lib/api/Settings.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const express = require("express"); diff --git a/lib/base-cli/Inquirer.js b/lib/base-cli/Inquirer.js index f2a64a195..9977556af 100644 --- a/lib/base-cli/Inquirer.js +++ b/lib/base-cli/Inquirer.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const chalk = require("chalk"); diff --git a/lib/base-cli/index.js b/lib/base-cli/index.js index ff842bf6e..3873c1cad 100644 --- a/lib/base-cli/index.js +++ b/lib/base-cli/index.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const { Inquirer } = require("./Inquirer"); diff --git a/lib/common/constants.js b/lib/common/constants.js index 5f02d119b..f777aeda8 100644 --- a/lib/common/constants.js +++ b/lib/common/constants.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + module.exports = { FUNCTION_TYPE: "function", WATCH_RELOAD: "watch-reload" diff --git a/lib/common/helpers.js b/lib/common/helpers.js index c983574fc..5faced066 100644 --- a/lib/common/helpers.js +++ b/lib/common/helpers.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const stringToBoolean = val => { diff --git a/lib/common/options.js b/lib/common/options.js index ca3c62dcd..b8159d8f7 100644 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const commander = require("commander"); diff --git a/lib/common/tracer.js b/lib/common/tracer.js index 305b64319..c604c7863 100644 --- a/lib/common/tracer.js +++ b/lib/common/tracer.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const winston = require("winston"); diff --git a/lib/features/Feature.js b/lib/features/Feature.js index e14d6883c..7d0026341 100644 --- a/lib/features/Feature.js +++ b/lib/features/Feature.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const { cloneDeep, map, sum } = require("lodash"); diff --git a/lib/features/Features.js b/lib/features/Features.js index 9132ae425..71bd3bcc3 100644 --- a/lib/features/Features.js +++ b/lib/features/Features.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const Boom = require("boom"); diff --git a/lib/middlewares.js b/lib/middlewares.js index a5483c10e..06f3acf36 100644 --- a/lib/middlewares.js +++ b/lib/middlewares.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const bodyParser = require("body-parser"); diff --git a/lib/start.js b/lib/start.js index 694bd56af..68ed30c05 100644 --- a/lib/start.js +++ b/lib/start.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const Boom = require("boom"); diff --git a/package-lock.json b/package-lock.json index bfd215839..d68314d15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@xbyorange/mocks-server", + "name": "@mocks-server/main", "version": "1.0.1", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index 3db7da205..e7453bc61 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@xbyorange/mocks-server", + "name": "@mocks-server/main", "version": "1.0.1", "description": "Mocks server with extensible fixtures groupables in predefined behaviors. Behavior can be changed using CLI or REST API", "keywords": [ @@ -14,9 +14,9 @@ "testing", "development" ], - "author": "XByOrange", + "author": "Javier Brea", "license": "Apache-2.0", - "repository": "https://github.com/XbyOrange/mocks-server", + "repository": "https://github.com/mocks-server/main", "publishConfig": { "access": "public" }, diff --git a/sonar-project.properties b/sonar-project.properties index 937184641..ddb307462 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,11 +1,16 @@ -sonar.organization=javierbrea -sonar.projectKey=xbyorange-mocks-server +sonar.organization=mocks-server +sonar.projectKey=mocks-server-main sonar.projectVersion=1.0.1 -sonar.sources=lib,test +sonar.javascript.file.suffixes=.js +sonar.sourceEncoding=UTF-8 sonar.exclusions=node_modules/** sonar.test.exclusions=test/**/* sonar.coverage.exclusions=test/**/* sonar.cpd.exclusions=test/** sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.host.url=https://sonarcloud.io + +sonar.issue.ignore.multicriteria=j1 +sonar.issue.ignore.multicriteria.j1.ruleKey=javascript:S4144 +sonar.issue.ignore.multicriteria.j1.resourceKey=test/**/*,test-acceptance/**/* diff --git a/test/acceptance/cli/autocomplete.spec.js b/test/acceptance/cli/autocomplete.spec.js index 4a3ed1205..947293ac7 100644 --- a/test/acceptance/cli/autocomplete.spec.js +++ b/test/acceptance/cli/autocomplete.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../../utils"); diff --git a/test/acceptance/cli/custom-quit.spec.js b/test/acceptance/cli/custom-quit.spec.js index 4cb520cd9..6c0ad2336 100644 --- a/test/acceptance/cli/custom-quit.spec.js +++ b/test/acceptance/cli/custom-quit.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../../utils"); diff --git a/test/acceptance/cli/exit-logs-mode.spec.js b/test/acceptance/cli/exit-logs-mode.spec.js index f12f300ce..7998ed734 100644 --- a/test/acceptance/cli/exit-logs-mode.spec.js +++ b/test/acceptance/cli/exit-logs-mode.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../../utils"); diff --git a/test/acceptance/cli/fixtures/autocomplete.js b/test/acceptance/cli/fixtures/autocomplete.js index 894017811..cf70e33e9 100644 --- a/test/acceptance/cli/fixtures/autocomplete.js +++ b/test/acceptance/cli/fixtures/autocomplete.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const baseCli = require("../../../../lib/base-cli"); const questions = { diff --git a/test/acceptance/cli/fixtures/custom-quit-method.js b/test/acceptance/cli/fixtures/custom-quit-method.js index fd6efc1b4..4cb9352d5 100644 --- a/test/acceptance/cli/fixtures/custom-quit-method.js +++ b/test/acceptance/cli/fixtures/custom-quit-method.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const baseCli = require("../../../../lib/base-cli"); const questions = { diff --git a/test/acceptance/cli/fixtures/exit-logs-mode.js b/test/acceptance/cli/fixtures/exit-logs-mode.js index e93986d4a..9db37b80a 100644 --- a/test/acceptance/cli/fixtures/exit-logs-mode.js +++ b/test/acceptance/cli/fixtures/exit-logs-mode.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const baseCli = require("../../../../lib/base-cli"); const questions = { diff --git a/test/acceptance/cli/fixtures/logs-mode.js b/test/acceptance/cli/fixtures/logs-mode.js index 92a479539..0d855ce26 100644 --- a/test/acceptance/cli/fixtures/logs-mode.js +++ b/test/acceptance/cli/fixtures/logs-mode.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const baseCli = require("../../../../lib/base-cli"); const questions = { diff --git a/test/acceptance/cli/fixtures/readme-example.js b/test/acceptance/cli/fixtures/readme-example.js index 38fafb87e..0b3bb4daa 100644 --- a/test/acceptance/cli/fixtures/readme-example.js +++ b/test/acceptance/cli/fixtures/readme-example.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const baseCli = require("../../../../lib/base-cli"); const questions = { diff --git a/test/acceptance/cli/fixtures/remove-listeners.js b/test/acceptance/cli/fixtures/remove-listeners.js index bc9163cc9..c6a56b1df 100644 --- a/test/acceptance/cli/fixtures/remove-listeners.js +++ b/test/acceptance/cli/fixtures/remove-listeners.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const baseCli = require("../../../../lib/base-cli"); const questions = { diff --git a/test/acceptance/cli/logs-mode.spec.js b/test/acceptance/cli/logs-mode.spec.js index 020bd1fd3..963c427ae 100644 --- a/test/acceptance/cli/logs-mode.spec.js +++ b/test/acceptance/cli/logs-mode.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../../utils"); diff --git a/test/acceptance/cli/readme-example.spec.js b/test/acceptance/cli/readme-example.spec.js index 7924370e2..e8b138bf8 100644 --- a/test/acceptance/cli/readme-example.spec.js +++ b/test/acceptance/cli/readme-example.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../../utils"); diff --git a/test/acceptance/cli/remove-listeners.spec.js b/test/acceptance/cli/remove-listeners.spec.js index 013b4a14b..4a91a19e5 100644 --- a/test/acceptance/cli/remove-listeners.spec.js +++ b/test/acceptance/cli/remove-listeners.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../../utils"); diff --git a/test/acceptance/mocks-server-bin.spec.js b/test/acceptance/mocks-server-bin.spec.js index c061ab3bc..a95d7204c 100644 --- a/test/acceptance/mocks-server-bin.spec.js +++ b/test/acceptance/mocks-server-bin.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const { CliRunner } = require("../utils"); diff --git a/test/unit/api/Api.mocks.js b/test/unit/api/Api.mocks.js index 119343b0f..eea29cf36 100644 --- a/test/unit/api/Api.mocks.js +++ b/test/unit/api/Api.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/api/Api"); diff --git a/test/unit/api/Api.spec.js b/test/unit/api/Api.spec.js index 227909737..7c892addc 100644 --- a/test/unit/api/Api.spec.js +++ b/test/unit/api/Api.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const express = require("express"); const sinon = require("sinon"); diff --git a/test/unit/api/Features.mocks.js b/test/unit/api/Features.mocks.js index 140607f7a..fd5e8c13a 100644 --- a/test/unit/api/Features.mocks.js +++ b/test/unit/api/Features.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/api/Features"); diff --git a/test/unit/api/Features.spec.js b/test/unit/api/Features.spec.js index f5870caec..9c5786204 100644 --- a/test/unit/api/Features.spec.js +++ b/test/unit/api/Features.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const express = require("express"); const sinon = require("sinon"); diff --git a/test/unit/api/Settings.mocks.js b/test/unit/api/Settings.mocks.js index 288cf4a35..2a6ba9656 100644 --- a/test/unit/api/Settings.mocks.js +++ b/test/unit/api/Settings.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/api/Settings"); diff --git a/test/unit/api/Settings.spec.js b/test/unit/api/Settings.spec.js index 4680064d5..56d1f7513 100644 --- a/test/unit/api/Settings.spec.js +++ b/test/unit/api/Settings.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const express = require("express"); const sinon = require("sinon"); diff --git a/test/unit/cli/Inquirer.spec.js b/test/unit/cli/Inquirer.spec.js index 34de9b264..2853c7e64 100644 --- a/test/unit/cli/Inquirer.spec.js +++ b/test/unit/cli/Inquirer.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const inquirer = require("inquirer"); const sinon = require("sinon"); const chalk = require("chalk"); diff --git a/test/unit/common/Libs.mocks.js b/test/unit/common/Libs.mocks.js index d8299b4c3..3a18faf71 100644 --- a/test/unit/common/Libs.mocks.js +++ b/test/unit/common/Libs.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const http = require("http"); diff --git a/test/unit/common/options.spec.js b/test/unit/common/options.spec.js index 3bf211dac..ea16c238b 100644 --- a/test/unit/common/options.spec.js +++ b/test/unit/common/options.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const commander = require("commander"); diff --git a/test/unit/common/tracer.spec.js b/test/unit/common/tracer.spec.js index 353db46be..eba455542 100644 --- a/test/unit/common/tracer.spec.js +++ b/test/unit/common/tracer.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const tracer = require("../../../lib/common/tracer"); diff --git a/test/unit/features/Feature.spec.js b/test/unit/features/Feature.spec.js index 06f77c4ca..e810f7ee3 100644 --- a/test/unit/features/Feature.spec.js +++ b/test/unit/features/Feature.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + jest.mock("route-parser"); const routeParser = require("route-parser"); diff --git a/test/unit/features/Features.mocks.js b/test/unit/features/Features.mocks.js index ee21b4725..a8a567377 100644 --- a/test/unit/features/Features.mocks.js +++ b/test/unit/features/Features.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/features/Features"); diff --git a/test/unit/features/Features.spec.js b/test/unit/features/Features.spec.js index 1108b51d3..e405c46b6 100644 --- a/test/unit/features/Features.spec.js +++ b/test/unit/features/Features.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const Boom = require("boom"); const { cloneDeep } = require("lodash"); diff --git a/test/unit/index.spec.js b/test/unit/index.spec.js index 1ed27ff80..5e0d997ef 100644 --- a/test/unit/index.spec.js +++ b/test/unit/index.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const index = require("../../index"); describe("index", () => { diff --git a/test/unit/lib/BaseCli.mocks.js b/test/unit/lib/BaseCli.mocks.js index 7e7291928..26f957749 100644 --- a/test/unit/lib/BaseCli.mocks.js +++ b/test/unit/lib/BaseCli.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const cliBase = require("../../../lib/base-cli"); diff --git a/test/unit/lib/Cli.mocks.js b/test/unit/lib/Cli.mocks.js index 23d51617c..687b0fcbd 100644 --- a/test/unit/lib/Cli.mocks.js +++ b/test/unit/lib/Cli.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/Cli"); diff --git a/test/unit/lib/Cli.spec.js b/test/unit/lib/Cli.spec.js index 9da185d43..add4830ee 100644 --- a/test/unit/lib/Cli.spec.js +++ b/test/unit/lib/Cli.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const ServerMocks = require("./Server.mocks.js"); diff --git a/test/unit/lib/Server.mocks.js b/test/unit/lib/Server.mocks.js index 8f410ac3c..ddca55b98 100644 --- a/test/unit/lib/Server.mocks.js +++ b/test/unit/lib/Server.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/Server"); diff --git a/test/unit/lib/Server.spec.js b/test/unit/lib/Server.spec.js index 36cead4d6..a3f780a78 100644 --- a/test/unit/lib/Server.spec.js +++ b/test/unit/lib/Server.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const path = require("path"); const sinon = require("sinon"); diff --git a/test/unit/lib/Settings.mocks.js b/test/unit/lib/Settings.mocks.js index e5f47553b..fa02255a4 100644 --- a/test/unit/lib/Settings.mocks.js +++ b/test/unit/lib/Settings.mocks.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); jest.mock("../../../lib/Settings"); diff --git a/test/unit/lib/Settings.spec.js b/test/unit/lib/Settings.spec.js index 2415bbfeb..4c6437ea4 100644 --- a/test/unit/lib/Settings.spec.js +++ b/test/unit/lib/Settings.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const Settings = require("../../../lib/Settings"); describe("Settings", () => { diff --git a/test/unit/lib/helpers.spec.js b/test/unit/lib/helpers.spec.js index 6f3ebb1ec..241624891 100644 --- a/test/unit/lib/helpers.spec.js +++ b/test/unit/lib/helpers.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const helpers = require("../../../lib/common/helpers"); describe("helpers", () => { diff --git a/test/unit/lib/middlewares.spec.js b/test/unit/lib/middlewares.spec.js index 0ad37d057..3181154da 100644 --- a/test/unit/lib/middlewares.spec.js +++ b/test/unit/lib/middlewares.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const Boom = require("boom"); diff --git a/test/unit/lib/start.spec.js b/test/unit/lib/start.spec.js index 6da0b5a62..dc7b753bb 100644 --- a/test/unit/lib/start.spec.js +++ b/test/unit/lib/start.spec.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + const sinon = require("sinon"); const Boom = require("boom"); diff --git a/test/utils/CliRunner.js b/test/utils/CliRunner.js index b331ca4e1..2c7333ef7 100644 --- a/test/utils/CliRunner.js +++ b/test/utils/CliRunner.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const EventEmitter = require("events"); diff --git a/test/utils/index.js b/test/utils/index.js index 377a9631d..8abba1bf8 100644 --- a/test/utils/index.js +++ b/test/utils/index.js @@ -1,3 +1,13 @@ +/* +Copyright 2019 XbyOrange + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +*/ + "use strict"; const CliRunner = require("./CliRunner"); From a8b8a52c9ae3ec1a6445374f9c30951126f3b766 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 08:54:20 +0100 Subject: [PATCH 02/19] Upgrade version --- package-lock.json | 2 +- package.json | 2 +- sonar-project.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d68314d15..a845e2ae7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@mocks-server/main", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e7453bc61..27ed902c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mocks-server/main", - "version": "1.0.1", + "version": "1.0.2", "description": "Mocks server with extensible fixtures groupables in predefined behaviors. Behavior can be changed using CLI or REST API", "keywords": [ "mocks", diff --git a/sonar-project.properties b/sonar-project.properties index ddb307462..525a44cf0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ sonar.organization=mocks-server sonar.projectKey=mocks-server-main -sonar.projectVersion=1.0.1 +sonar.projectVersion=1.0.2 sonar.javascript.file.suffixes=.js sonar.sourceEncoding=UTF-8 From 5b7795bd225a8df181858bc114e292d4fc9e8de6 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 08:58:19 +0100 Subject: [PATCH 03/19] Fix sonar organization --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 559e143dc..e43cf430d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: addons: sonarcloud: - organization: "javierbrea" + organization: "mocks-server" token: secure: "$SONAR_TOKEN" branch: From b2e0e2941d885b9c120f94fda5a938b228984fa2 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:07:41 +0100 Subject: [PATCH 04/19] Add change to changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e247ca58b..16cb149c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed ### Removed +## [1.0.2] - 2019-11-08 +### Changed +- Project forked from xbyorange/mocks-server. Fixed license. Read NOTICE for further details + ## [1.0.1] - 2019-06-04 ### Fixed - Upgrade dependencies to fix potential security vulnerability From 302fa7e3b98ed3c467e04e23cc2d41b0f892edb6 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:20:34 +0100 Subject: [PATCH 05/19] remove sonar cache --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e43cf430d..71afdfd31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ node_js: cache: directories: - "node_modules" - - "$HOME/.sonar/cache" addons: sonarcloud: From 185537b37afed28948600ea479eb22355eecc9fc Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:31:43 +0100 Subject: [PATCH 06/19] Fix sonarcloud config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 71afdfd31..a84b74002 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ addons: sonarcloud: organization: "mocks-server" token: - secure: "$SONAR_TOKEN" + secure: $SONAR_TOKEN branch: name: "$TRAVIS_CURRENT_BRANCH" From 3bc9e1e82b675bf41951f56e58e78bc0ae96a122 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:37:41 +0100 Subject: [PATCH 07/19] Sonarcloud config --- .travis.yml | 2 +- sonar-project.properties | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a84b74002..71afdfd31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ addons: sonarcloud: organization: "mocks-server" token: - secure: $SONAR_TOKEN + secure: "$SONAR_TOKEN" branch: name: "$TRAVIS_CURRENT_BRANCH" diff --git a/sonar-project.properties b/sonar-project.properties index 525a44cf0..3f6845e02 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,7 +10,3 @@ sonar.coverage.exclusions=test/**/* sonar.cpd.exclusions=test/** sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.host.url=https://sonarcloud.io - -sonar.issue.ignore.multicriteria=j1 -sonar.issue.ignore.multicriteria.j1.ruleKey=javascript:S4144 -sonar.issue.ignore.multicriteria.j1.resourceKey=test/**/*,test-acceptance/**/* From 6660fbc425c6c9890c4811ebe91008f8af803fe0 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:47:05 +0100 Subject: [PATCH 08/19] Change sonar project for testing permissions --- .travis.yml | 6 ++++-- sonar-project.properties | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71afdfd31..3aab69061 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,13 @@ node_js: cache: directories: - - "node_modules" + - ~/.npm + - node_modules + - ~/.sonar/cache addons: sonarcloud: - organization: "mocks-server" + organization: "javierbrea" token: secure: "$SONAR_TOKEN" branch: diff --git a/sonar-project.properties b/sonar-project.properties index 3f6845e02..fc4fc5b17 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ -sonar.organization=mocks-server +sonar.organization=javierbrea sonar.projectKey=mocks-server-main sonar.projectVersion=1.0.2 From 49a85b9f597d841ce7d7d39938977a256cd8c806 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:55:55 +0100 Subject: [PATCH 09/19] Use manual command with variable instead of travis secure --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3aab69061..396250a55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: - npm run lint - npm run test-ci - npm run coveralls - - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi' + - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.login=${SONAR_TOKEN}; fi' deploy: provider: npm From d7ffa3402831113c66a2bda2ea04a2d2db524c66 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:56:53 +0100 Subject: [PATCH 10/19] Fix sonar command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 396250a55..a4aef73b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: - npm run lint - npm run test-ci - npm run coveralls - - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.login=${SONAR_TOKEN}; fi' + - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.login=${SONAR_TOKEN}; fi' deploy: provider: npm From a3f2c96c1b4244ec81ee9d7fddb0b2977752cbcb Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:57:15 +0100 Subject: [PATCH 11/19] comment all other commands --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4aef73b5..160422b10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ addons: name: "$TRAVIS_CURRENT_BRANCH" script: - - npm run lint - - npm run test-ci - - npm run coveralls + #- npm run lint + #- npm run test-ci + #- npm run coveralls - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.login=${SONAR_TOKEN}; fi' deploy: From 28f0baf7bf42416e3ebbb6f951450af0884acee2 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 09:59:37 +0100 Subject: [PATCH 12/19] Fix sonar auth --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 160422b10..b8e0a0ef7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: #- npm run lint #- npm run test-ci #- npm run coveralls - - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.login=${SONAR_TOKEN}; fi' + - sonar:sonar -Dsonar.login=${SONAR_TOKEN} deploy: provider: npm From 00c3abd46b882f04d94483e41ca66e413b3e19c7 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:01:25 +0100 Subject: [PATCH 13/19] Fix sonar command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b8e0a0ef7..c5e097ea2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: #- npm run lint #- npm run test-ci #- npm run coveralls - - sonar:sonar -Dsonar.login=${SONAR_TOKEN} + - sonar-scanner -Dsonar.login=${SONAR_TOKEN} deploy: provider: npm From deaf2c8a8483c054e7b5f151b0ccd6e917873182 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:03:20 +0100 Subject: [PATCH 14/19] Remove sonar token secure travis-ci setting --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5e097ea2..3dbdaa47e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ cache: addons: sonarcloud: organization: "javierbrea" - token: - secure: "$SONAR_TOKEN" + # token: + # secure: "$SONAR_TOKEN" branch: name: "$TRAVIS_CURRENT_BRANCH" From 0874b221e747c9ff46a9a3ea556a3e7891ab2a04 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:05:54 +0100 Subject: [PATCH 15/19] Enable all other commands --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3dbdaa47e..d16a364d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,15 +12,15 @@ cache: addons: sonarcloud: organization: "javierbrea" - # token: - # secure: "$SONAR_TOKEN" + token: + secure: "$SONAR_TOKEN" branch: name: "$TRAVIS_CURRENT_BRANCH" script: - #- npm run lint - #- npm run test-ci - #- npm run coveralls + - npm run lint + - npm run test-ci + - npm run coveralls - sonar-scanner -Dsonar.login=${SONAR_TOKEN} deploy: From 7f63946223257927c97a0feba12bbd4d203e896a Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:11:16 +0100 Subject: [PATCH 16/19] Change sonarcloud organization --- .travis.yml | 4 +--- sonar-project.properties | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d16a364d6..b434a855d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,7 @@ cache: addons: sonarcloud: - organization: "javierbrea" - token: - secure: "$SONAR_TOKEN" + organization: "mocks-server" branch: name: "$TRAVIS_CURRENT_BRANCH" diff --git a/sonar-project.properties b/sonar-project.properties index fc4fc5b17..3f6845e02 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,4 @@ -sonar.organization=javierbrea +sonar.organization=mocks-server sonar.projectKey=mocks-server-main sonar.projectVersion=1.0.2 From 235d297e6668435fc9ab4265f454e1938dea01c2 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:27:41 +0100 Subject: [PATCH 17/19] Fix some minor sonar bugs and code smells --- LICENSE | 2 +- lib/Cli.js | 5 ++++- sonar-project.properties | 4 ++++ test/utils/CliRunner.js | 5 ++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index b43ac6227..58a0db862 100644 --- a/LICENSE +++ b/LICENSE @@ -175,5 +175,5 @@ END OF TERMS AND CONDITIONS - Copyright 2019 Javier Brea + Copyright 2019 Javier Brea and contributors Copyright 2019 XbyOrange diff --git a/lib/Cli.js b/lib/Cli.js index 2e1856351..48553d658 100644 --- a/lib/Cli.js +++ b/lib/Cli.js @@ -1,4 +1,5 @@ /* +Copyright 2019 Javier Brea Copyright 2019 XbyOrange Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -142,7 +143,9 @@ class Cli { if (!input || !input.length) { return Promise.resolve(featuresNames); } - return Promise.resolve(featuresNames.filter(feature => feature.includes(input))); + return Promise.resolve( + featuresNames.filter(currentFeature => currentFeature.includes(input)) + ); } }); this._features.current = feature; diff --git a/sonar-project.properties b/sonar-project.properties index 3f6845e02..a3e12a3bf 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,3 +10,7 @@ sonar.coverage.exclusions=test/**/* sonar.cpd.exclusions=test/** sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.host.url=https://sonarcloud.io + +sonar.issue.ignore.multicriteria=j1 +sonar.issue.ignore.multicriteria.j1.ruleKey=javascript:S4144 +sonar.issue.ignore.multicriteria.j1.resourceKey=test/**/* diff --git a/test/utils/CliRunner.js b/test/utils/CliRunner.js index 2c7333ef7..8240bf9e0 100644 --- a/test/utils/CliRunner.js +++ b/test/utils/CliRunner.js @@ -1,4 +1,5 @@ /* +Copyright 2019 Javier Brea Copyright 2019 XbyOrange Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -116,7 +117,9 @@ module.exports = class CliRunner { return this._exitPromise; } - async hasPrinted(data, action, timeOut = 1000) { + async hasPrinted(data, inputAction, inputTimeOut = 1000) { + let timeOut = inputTimeOut; + let action = inputAction; if (isNumber(action)) { timeOut = action; action = null; From df99fef6c1cc30fbd6ddcf63aabb27395e6fc451 Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:28:25 +0100 Subject: [PATCH 18/19] Add changes to changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16cb149c4..e525925c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Project forked from xbyorange/mocks-server. Fixed license. Read NOTICE for further details +### Fixed +- Fix some minor Sonar bugs and code smells. + ## [1.0.1] - 2019-06-04 ### Fixed - Upgrade dependencies to fix potential security vulnerability From b5b7e329edc0dc904e93a2a78084c487aa5eb51e Mon Sep 17 00:00:00 2001 From: javierbrea Date: Fri, 8 Nov 2019 10:38:54 +0100 Subject: [PATCH 19/19] ignore config files from coverage --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index a3e12a3bf..1c534e4af 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,7 +4,7 @@ sonar.projectVersion=1.0.2 sonar.javascript.file.suffixes=.js sonar.sourceEncoding=UTF-8 -sonar.exclusions=node_modules/** +sonar.exclusions=node_modules/**,*.config.js sonar.test.exclusions=test/**/* sonar.coverage.exclusions=test/**/* sonar.cpd.exclusions=test/**