You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER` and `MYSQL_PASSWORD`. (You may want to put these in a `config.sh` file and source it when you run the tests). Then run `make test`.
1023
+
Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER` and `MYSQL_PASSWORD`. Then run `npm test`.
1024
1024
1025
1025
For example, if you have an installation of mysql running on localhost:3306 and no password set for the `root` user, run:
1026
1026
1027
1027
```
1028
1028
mysql -u root -e "CREATE DATABASE IF NOT EXISTS node_mysql_test"
1029
-
MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_DATABASE=node_mysql_test MYSQL_USER=root MYSQL_PASSWORD= make test
1029
+
MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_DATABASE=node_mysql_test MYSQL_USER=root MYSQL_PASSWORD= npm test
1030
1030
```
1031
1031
1032
-
## Running unit tests on windows
1033
-
1034
-
* Edit the variables in the file ```make.bat``` according to your system and mysql-settings.
1035
-
* Make sure the database (e.g. 'test') you want to use exists and the user you entered has the proper rights to use the test database. (E.g. do not forget to execute the SQL-command ```FLUSH PRIVILEGES``` after you have created the user.)
1036
-
* In a DOS-box (or CMD-shell) in the folder of your application run ```npm install mysql --dev``` or in the mysql folder (```node_modules\mysql```), run ```npm install --dev```. (This will install additional developer-dependencies for node-mysql.)
1037
-
* Run ```npm test mysql``` in your applications folder or ```npm test``` in the mysql subfolder.
1038
-
* If you want to log the output into a file use ```npm test mysql > test.log``` or ```npm test > test.log```.
0 commit comments