Can't run mocha, opens editor to mocha.js - npm

I'm trying to setup mocha tests in my project using the globally installed mocha, which is the latest version (1.7.7 at the time of writing).
Instead of doing something, it opens my default editor and opens the file mocha.js. Running mocha does this; mocha test ., mocha --help, and npm test also gives the same result. Installing it locally produced the same effect.
Is this just some configuration error? Maybe I've missed a step during setup? Please advise me on how to fix this.

Nvm, I was just being dull. I had run mocha init ., which somehow messed it up.
Removing the generated mocha.js and mocha.css files did the trick.
If anyone could explain why this happens though, that'd be great! :)

Related

Vue CLI: What exactly happens when I use "npm install"?

I've been using the command line for some time now, but I'm still not sure what exactly happens when I do certain things - and I'm not sure what to google for help.
When I'm working with Anaconda and Python, I found the environments I created in C:\Users\<User>\Anaconda3\envs. And every python package I install in an environment seems to go there. Great!
But how does this work outside of Anaconda/Python? For example, I installed the vue CLI via npm install -g #vue/cli. What exactly happens when I do this; or more precicely, where are files saved?
During the creation of a new vue project, a readme.md is created as well. It states that users should simply npm install to setup the project. It seems that this command installs all packages stated in the package.json. I would like to try out if this command works for new users, but I already (obviously) have everything installed. Can I create some kind of environment (like I do with Anaconda for Python) to accomplish this?
Thanks a lot for your answers!

How to fix errors in Gridsome.js?

Problem Summary
So I'm trying to launch a new Gridsome project for local development. I've toyed with Gridsome in the past and had a great experience, so I decided to give it another shot.
This time around; however, when I run the gridsome create command, the system creates a new Gridsome site directory as expected but returns the following error message:
The instructions in this error message say to enter the newly-created site directory and run gridsome develop to start local development. However, after running cd my-gridsome-site and subsequently running gridsome develop, I then receive this error:
So far, I've tried running npm install --save from the site directory as well as yarn install, both to no avail. Thinking that this was possibly tied to my terminal, I switched from using the Zsh terminal to using the Bash terminal. This also did not work.
I'm at a loss here and could really use a hand.
Thank you for helping,
David
This seems to be an environment error. Gridsome requires Node.js (v8.3+) and recommends Yarn.
Make sure your Node.js version is v8.3+ and use only one package manager like Yarn.
to check node version: node -v
I had this same issue, but I resolved it after installing yarn and running the project with yarn instead of NPM. So you should try using yarn it will help,

PyCharm can't seem to be able to import modules (random, webdriver)

I recently installed MacOS BigSur, and updated to the latest version of PyCharm, but I think it totally broke it.
Indeed, I mostly use Selenium, and I had trouble installing the package, but I managed to do it via the mac terminal, using this command:
/Users/inakivignal/PycharmProjects/NikeFP/venv/bin/python -m pip install selenium
After that, it shows me errors from importing webdriver and even importing random. I don't know what else to do, because before it imported them directly from packages. I verified and selenium is indeed installed as an interpreter in this project.
I'll attach what it shows me when i put this code:
code
I really don't know what is wrong with my PyCharm, if any of you could help me I would really appreciate it.
Thanks
If you are sure that it is installed, you could right click on the error, then take the option "install package Selenium" looking like this: https://gyazo.com/2f7ed596192c772d164652e2a5fdbc0b
not sure if this helps but worth a try, also had problems with this

npm pkg timeout issue

Now I have implemented automated testing with a puppeteer and I have packaged it and executed it.
However, after six hours, I found that the file packaged in a pkg was not running and stopped.
I used "npm pkg" to package.
Is there anyone who is talking about this issue?
add comment
:https://www.npmjs.com/package/pkg. I installed the npm pkg module after seeing this place.
I'm in the process of automated testing of a website with a puppeteer and it took me more than six hours to spin the executable file to run the test on this website.
We executed exe file by packaging code written with puppeteer using 'pkg' module.
I had a screenshot of the execution process because I was testing the website, and after six hours, I found that the screenshot was not being taken from a certain point in time.
I have already completed the unit test of my code, so I judged that there was a problem with the pkg file, not with my code or with the website.
my try:
I was setting the option for reload to waitUntil:networkidle0 I think this option is the problem. I set networkidle0 to networkidle2, and it works well. Is there anyone who knows about the difference in this?

Hot Reload during Unit testing

I develop right now a small flutter app. I think as everyone, I fell in love with the hot reload feature.
So now I'm wondering if there is any possibility to have the same developer experience during unit test. Do have to turn a flag somewhere or is it right know just no possible.
If is not possible, are there any plans to make it possible?
I guess what you want is to run the new tests as soon as they changed. But in that case it's not a hot reload. Simply a watcher that detect whenever your sources or your tests have changed and restart them.
Flutter, and the lower layers, don't implement "watch" yet. Although you can achieve a similar effect quite easily using a node packages
npm i -g watch which will install watch globally so that you can use it in as a command line.
and then in your terminal do
watch "flutter test" lib test which will run flutter test everytime something change inside lib and test folders
You need to run the unit test as an app to be able to use hot reload.
In IntelliJ you can copy the run configuration for lib/main.dart and then select the file test/my_test.dart in the copy.
There is no support to run single tests from a set of tests in a test file in IntelliJ (don't know other IDEs) when you run a test this way.
In my opinion, if you run it as unit test, hot reload doesn't bring much benefit anyway because execution is very fast.