lepathie / AMe-Forum

A forum engine built on top of Angular and Meteor.
MIT License
0 stars 0 forks source link

npm run test isn't working #32

Closed lepathie closed 4 years ago

lepathie commented 4 years ago

npm run test doesn't seem to work as intended.

I am running the project on WSL1.

The error occurs in the client tests.

Puppeteer is installed in v3.1.0.

--------------------------------
----- RUNNING CLIENT TESTS -----
--------------------------------
(node:2039) Warning: N-API is an experimental feature and could change at any time.
TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
    at promisify (internal/util.js:209:11)
    at Object.<anonymous> (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/extract-zip/index.js:11:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/puppeteer/lib/BrowserFetcher.js:26:20)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/runner.js:873
  throw err;
  ^

Error: When running app tests with TEST_BROWSER_DRIVER=puppeteer, you must first "npm i --save-dev puppeteer@^1.5.0"
    at startPuppeteer (packages/ardatan:mocha/browser-tests/browser/puppeteer.js:22:11)
    at startBrowser (packages/ardatan:mocha/browser-tests/server.js:35:7)
    at clientTests (packages/ardatan:mocha/server.js:134:3)
    at serverTests (packages/ardatan:mocha/server.js:159:7)
    at mochaInstance.run.failureCount (packages/ardatan:mocha/server.js:114:13)
    at done (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/mocha.js:934:7)
    at Runner.<anonymous> (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/runner.js:924:5)
    at emitNone (events.js:111:20)
    at Runner.emit (events.js:208:7)
    at /mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/runner.js:908:12
    at Runner.runSuite (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/runner.js:731:12)
    at start (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/runner.js:906:10)
    at Immediate._onImmediate (/mnt/f/Leon Thierschmidt/OneDrive/Dokumente/Git/AMe-Forum/node_modules/mocha/lib/runner.js:938:7)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
=> Exited with code: 7
=> Your application is crashing. Waiting for file change.
lepathie commented 4 years ago

This could be interesting: https://techoverflow.net/2018/06/05/how-to-fix-puppetteer-error-while-loading-shared-libraries-libx11-xcb-so-1-cannot-open-shared-object-file-no-such-file-or-directory/

lepathie commented 4 years ago

Just noticed that the driver-package isn't installed in our meteor project.

Will add this.

lepathie commented 4 years ago

A downgrade of pupetteer to ^1.20.0 also could do a thing.

lepathie commented 4 years ago

This could also come in handy: https://www.meteor.com/tutorials/angular/testing

lepathie commented 4 years ago

Maybe should switch from puppeteer to selenium.

https://tecadmin.net/setup-selenium-chromedriver-on-ubuntu/

lepathie commented 4 years ago

Currently running into this issue: https://github.com/meteortesting/meteor-mocha/issues/71

Getting further. :)

lepathie commented 4 years ago

Also this issue can be fixed: https://stackoverflow.com/questions/59362510/angular-browserslist-caniuse-lite-is-outdated-please-run-next-command-npm-upd

lepathie commented 4 years ago

Now running into: https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t

lepathie commented 4 years ago

The tests are running (failing though) on feature/enable_testing. Only on the github workflow though and not locally.