From 4b5193fa65b9aa4ca7fdf660a204bd128d39c199 Mon Sep 17 00:00:00 2001
From: Maxim Khlobystov <maxim.khlobystov@gmail.com>
Date: Thu, 22 Nov 2018 13:22:52 -0500
Subject: [PATCH] Moving tests-related dependencies to the main package.json

---
 bigbluebutton-html5/package.json              | 12 +++++++++-
 bigbluebutton-html5/tests/puppeteer/README.md |  4 ++--
 .../tests/puppeteer/package.json              | 22 -------------------
 build_script.sh                               |  2 --
 4 files changed, 13 insertions(+), 27 deletions(-)
 delete mode 100644 bigbluebutton-html5/tests/puppeteer/package.json

diff --git a/bigbluebutton-html5/package.json b/bigbluebutton-html5/package.json
index 05ceb55db4..1b6144dbde 100755
--- a/bigbluebutton-html5/package.json
+++ b/bigbluebutton-html5/package.json
@@ -9,7 +9,7 @@
     "generate-refs-visual-regression-desktop": "rm -rf tests/webdriverio/screenshots; npm run test-visual-regression-desktop",
     "start:prod": "meteor reset && ROOT_URL=http://127.0.0.1/html5client NODE_ENV=production meteor --production",
     "start:dev": "ROOT_URL=http://127.0.0.1/html5client NODE_ENV=development meteor",
-    "test": "wdio ./tests/webdriverio/wdio.conf.js",
+    "test": "jest",
     "lint": "eslint . --ext .jsx,.js",
     "precommit": "lint-staged"
   },
@@ -70,7 +70,9 @@
     "yaml": "^1.0.0"
   },
   "devDependencies": {
+    "axios": "^0.18.0",
     "chai": "~4.1.2",
+    "dotenv": "^6.1.0",
     "eslint": "~4.9.0",
     "eslint-config-airbnb": "~16.1.0",
     "eslint-config-airbnb-base": "~12.1.0",
@@ -78,11 +80,14 @@
     "eslint-plugin-jsx-a11y": "~6.0.2",
     "eslint-plugin-react": "~7.4.0",
     "husky": "~0.14.3",
+    "jest": "^23.6.0",
     "lint-staged": "~4.3.0",
     "postcss-modules-extract-imports": "1.1.0",
     "postcss-modules-local-by-default": "1.2.0",
     "postcss-modules-scope": "1.1.0",
     "postcss-modules-values": "1.3.0",
+    "puppeteer": "^1.10.0",
+    "sha1": "^1.1.1",
     "wdio-jasmine-framework": "~0.3.2",
     "wdio-junit-reporter": "~0.4.4",
     "wdio-spec-reporter": "~0.1.2",
@@ -105,6 +110,11 @@
       "autoprefixer": {}
     }
   },
+  "jest": {
+    "modulePathIgnorePatterns": [
+      "/tests/webdriverio"
+    ]
+  },
   "repository": {
     "type": "git",
     "url": "https://github.com/bigbluebutton/bigbluebutton.git"
diff --git a/bigbluebutton-html5/tests/puppeteer/README.md b/bigbluebutton-html5/tests/puppeteer/README.md
index 4508a3d466..8122661af5 100644
--- a/bigbluebutton-html5/tests/puppeteer/README.md
+++ b/bigbluebutton-html5/tests/puppeteer/README.md
@@ -11,7 +11,7 @@ To run these tests, you will need the following:
 
 These instructions assume you have the BigBlueButton repository cloned into a directory named `bigbluebutton`.
 
-First, install the required modules with `npm install`, from this directory. When Puppeteer installs, it will automatically install the Chromium browser in which the tests will run.
+First, you need to have the dependencies installed with `meteor npm install`, from the `bigbluebutton-html5` directory. When Puppeteer installs, it will automatically install the Chromium browser in which the tests will run.
 
 To run individual tests, you can also optionally install Jest globally with `sudo npm install jest -g`.
 
@@ -34,4 +34,4 @@ The HTML5 client takes a long time to start in the Docker container. The script
 ## Known Issues
 
 * Hotkeys do not work yet. When hotkeys are pressed, keydown and keyup events are fired, but the click events that would normally be created to press buttons do not occur.
-* Some tests will sometimes fail with a timeout error. Different tests may fail every time the tests are run. This problem affects all tests, and the cause is unknown as of now.
\ No newline at end of file
+* Some tests will sometimes fail with a timeout error. Different tests may fail every time the tests are run. This problem affects all tests, and the cause is unknown as of now.
diff --git a/bigbluebutton-html5/tests/puppeteer/package.json b/bigbluebutton-html5/tests/puppeteer/package.json
deleted file mode 100644
index 32f72ff3d9..0000000000
--- a/bigbluebutton-html5/tests/puppeteer/package.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "name": "bigbluebutton-tests",
-  "version": "1.0.0",
-  "description": "",
-  "main": "app.js",
-  "scripts": {
-    "test": "jest"
-  },
-  "jest": {
-    "verbose": false
-  },
-  "author": "",
-  "license": "ISC",
-  "dependencies": {
-    "axios": "^0.18.0",
-    "dotenv": "^6.0.0",
-    "jest": "^23.5.0",
-    "puppeteer": "^1.7.0",
-    "sha1": "^1.1.1"
-  },
-  "devDependencies": {}
-}
diff --git a/build_script.sh b/build_script.sh
index 42265a3dba..e04f3c97fe 100755
--- a/build_script.sh
+++ b/build_script.sh
@@ -22,11 +22,9 @@ if [[ $files = *"bigbluebutton-html5"* ]]; then
     } > /dev/null
 
     cd tests/puppeteer
-    npm install
     conf=$(docker exec $(docker ps -q) bbb-conf --secret | grep "Secret:")
     secret=$(echo $conf | cut -d' ' -f2)
     export BBB_SHARED_SECRET=$secret
-
     node html5-check.js
     npm test
   fi
-- 
GitLab