aboutsummaryrefslogtreecommitdiffstats
path: root/tests/README.txt
diff options
context:
space:
mode:
authorBrandon Lo <lobrandon1217@gmail.com>2019-07-11 09:49:11 -0400
committerBrandon Lo <lobrandon1217@gmail.com>2019-07-16 11:39:24 -0400
commit0aba5286824d653f95a6454de0fbf91d4a5410b8 (patch)
tree4c5f49e916beba3a7b82a7e20a2650f62f98e60a /tests/README.txt
parent69824a2839f8841c04d964ea341b4a8b1379aa51 (diff)
LAAS-44: Unit Test Javascript
Add Karma, Mocha, and Chai NPM packages to allow for browser based front-end JavaScript testing. Not all functions are tested, but a lot of the required behavior is. This allows for new JS unit tests in future patches. Change-Id: I2ac2a865ed3a458d8f5ebdeb7c2b4defda24fd41 Signed-off-by: Brandon Lo <lobrandon1217@gmail.com>
Diffstat (limited to 'tests/README.txt')
-rw-r--r--tests/README.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/README.txt b/tests/README.txt
new file mode 100644
index 0000000..4085be7
--- /dev/null
+++ b/tests/README.txt
@@ -0,0 +1,32 @@
+This folder contains the tools needed to unit test the frontend
+JavaScript files using Karma, Mocha, and Chai.
+
+
+Getting started:
+Install NPM if you haven't:
+https://nodejs.org/en/download/package-manager/
+
+Run 'npm install' to install all required dependencies in this
+folder.
+
+Run 'npm test' to run current unit tests.
+
+
+Adding tests:
+Tests are located in the tests/ folder, you can simply edit the
+existing ones or create a new one by making a file with the .js
+file extension.
+
+Karma is used for launching different browsers to run JavaScript.
+See Karma documentation at https://karma-runner.github.io/
+to add more browsers, files to test, or frameworks.
+
+Mocha is used for the structure of the JavaScript testing itself.
+See Mocha documentation at https://mochajs.org/ to see the syntax
+required to create/modify tests. Currently, the tests use the
+'TDD' interface from Mocha.
+
+Chai is used for the actual testing, with it being an assertion
+library. See Chai documentation at https://www.chaijs.com/ to see
+the available usages for assertion. The tests use the 'assert' API
+along with Mocha's TDD interface.