JHipster and Karma: Error when i launch npm run test:watch - testing

I try to create my unit tests in my project with Jhipster 4.3 with Angular2.
But when i launch:
npm run test:watch
I have an error when i open http://localhost:9876/# and i can't debug my test:
Chrome 57.0.2987 (Windows 10 0.0.0) ERROR
You need to include some adapter that implements __karma__.start method!
I Have two questions:
Is it normal if i have this error with Jhipster default configuration?
How can I debug my test with Karma and the preprocessors with breackpoint in the chrome dev toolbar?
.
preprocessors: {'spec/entry.ts': ['webpack', 'sourcemap']}
Alternative solution **UPDATE:**
Actually, i launch the #angular-cli alternative:
ng test
But i can't correctly debug my test with breackpoint.
Thanks for your help!

Related

Unable to build app for production using Vue-tour library

We are not able to build the app into production. While we run npm run build we get an error, "expected and declaration or statement expected in a jsx file".
Steps to Reproduce:
Install v-tour and setup all tours for testing in local.
run npm run build
check the console for error
Expected behavior:
The app has to properly be built for production without any errors
Desktop (please complete the following information):
OS: Windows 11
Browser : Chrome
Version : 105.0.5195.127
Vue : #vue/cli 4.4.6
Node : 14.19.0
ScreenShots:
I've added an issue in v-tour's github repo

Cypress : npx cypress open command not working

I have downloaded nodejs and installed and set up in the path environment variable.
Downloaded Vscode and then created a project folder(automation).
From the terminal in the folder , provided the command npx init cypress
and then install cypress
wrote a piece of code and then tried executing npx cypress open, but nothing coming up.
Please advise
The issue has been resolved. Such an issue came because of security app of our organizations

NodeJS docker image to run Angular test in gitlab-ci

I have a small Angular app which I am try to build using gitlab-ci and node docker image, when I try to run the test using the command npm run test it fails with the following error :
ERROR [launcher]: No binary for Chrome browser on your platform. Please, set "CHROME_BIN" env variable.
gitlab-ci.yml
stages:
- build
variables:
NPM_CONFIG_REGISTRY: https://test.com/xx/api/npm/npm-all
build:
stage: build
image: node:12.9
script:
- npm install
- npm run build:prod
- npm run test
tags:
- DOCKER
In the above code npm run test executes ng test as configured in the package.json
I was able to run the build but when I run the test it looks for a chrome browser, I also tried running the test in a headless way using the below command but resulted in the same error :
ng test --no-watch --browsers=ChromeHeadless
How do I add the chrome feature to this build ?
Either install Chrome by yourself or try an existing Docker image that already includes it.

Nuxt: Command 'nuxt' not found - Output directory `dist/` does not exists

I have successfully created a Nuxt.js project with this configuration using the CLI:
Project name: test
Programming language: JavaScript
Package manager: Npm
UI framework: None
Nuxt.js modules: None
Linting tools: None
Testing framework: None
Rendering mode: Single Page App
Deployment target: Static (Static/JAMStack hosting)
Development tools: jsconfig.json
Version control system: Git
The developement server runs properly with npm run dev.
npm run build also runs without errors and tells me that:
Ready to run nuxt generate
But the execution of nuxt generate leads to the error Command 'nuxt' not found. This is strange because nuxt seems to be installed when I execute npm nuxt list.
I first reinstalled just nuxt and then all dependencies after deleting the node_modules/ folder, but the error remains the same. If I just run npm run start it tells me
Nuxt Fatal Error
Error: Output directory `dist/` does not exists, please use
`nuxt generate` before `nuxt start` for static target.
This is strange again because the .nuxt/dist/ folder exists.
Does anyone have an idea what is going wrong?
I have solved the problem. For me it works if I run npm run generate instead of nuxt generate.

Appium - Android - Error: spawn appium ENOENT

I am trying to run android tests with the command node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js and getting the following error:
me$ node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
I have the following versions in my package.json:
"wdio-appium-service": "^0.2.3",
"appium": "^1.12.1",
Please let me know what other info I can provide. Thank you.
I think I figured it out... in config/wdio.android.browser.conf.js I had services: [ 'appium' ], and trying to run just appium on my machine wasn't working. I installed appium globally with npm install -g appium and that made it work. I think I can point services to the appium in the local node_modules directory and maybe it would run it from there.
If you are using windows OS, appium section in your config file shall include command: 'appium.cmd' like this :
{
services: ['appium'],
appium: {
command: 'appium.cmd',
...
}
}
This error occurs due to 2 possible issues:
1) JAVAHOME variable is not correctly set for appium to start & run tests.
-> Check that JAVAHOME is correctly set and path points to the correct file.
2) There could have been some errors during Appium installation.
-> Try reinstalling appium using npm install -g appium command and ensure that appium is installed without any errors.
Obviously, run npm install to check and install any missing dependencies too.