ebidel / appmetrics.js

A small (< 1kb) library for measuring things in your web app and reporting the results to Google Analytics.
Apache License 2.0
1.37k stars 67 forks source link

Cannot run tests from fresh install #12

Open mdvorscak opened 6 years ago

mdvorscak commented 6 years ago

Actual behavior

After cloning and running yarn install && npm run test you get the following error:

appmetrics.js@0.0.9 test /home/mike/projects/appmetrics.js ./node_modules/mocha/bin/mocha

/home/mike/projects/appmetrics.js/test/test.js:4 const assert = chai.assert; ^

ReferenceError: chai is not defined at Object. (/home/mike/projects/appmetrics.js/test/test.js:4:16) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at /home/mike/projects/appmetrics.js/node_modules/mocha/lib/mocha.js:222:27 at Array.forEach () at Mocha.loadFiles (/home/mike/projects/appmetrics.js/node_modules/mocha/lib/mocha.js:219:14) at Mocha.run (/home/mike/projects/appmetrics.js/node_modules/mocha/lib/mocha.js:487:10) at Object. (/home/mike/projects/appmetrics.js/node_modules/mocha/bin/_mocha:459:18) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) at Function.Module.runMain (module.js:676:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3

Expected behavior

I can easily run tests with yarn install && npm run test. Actually needing to set up a server for the project folder is cumbersome and limits the ability for CI/CD.