Angular 4: Beginner to Pro Course - Unit Testing Issues

Hi Forum,

** START: Additional Info for the Forum:
This is a part copy of a message I sent to Mosh using the online form,
I appreciate that Angular 4 is Very out of Date, but I am a newbie and wanted a basic grounding in Angular.

In following the course, I am now stuck - Unit Testing Fundamentals;
I have gotten the samples
I have run npm install from the command line; yet when I run “ng test” the code reports an error: “No projects support the ‘test’ target.”

The output of ng --version is:
** ng version output:
ng --version

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 12.2.14
Node: 16.14.2 (Unsupported)
Package Manager: npm 8.5.0
OS: win32 x64

Angular:
… common, compiler, compiler-cli, core, forms, http
… platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1202.14 (cli-only)
@angular-devkit/core 12.2.14 (cli-only)
@angular-devkit/schematics 12.2.14 (cli-only)
@schematics/angular 12.2.14 (cli-only)
rxjs 6.6.7 (cli-only)
typescript 3.5.3 (cli-only)

Warning: The current version of Node (16.14.2) is not supported by Angular.

There is obviously an error as outlined by: "Angular: "
Please help to resolve this.

** Message on the online form for Mosh
Hi Mosh,

Being a somewhat newbie to Angular, I purchased your course.
Whereas I can understand that it does not cater for later versions of Angular, I would have hoped that the examples (with tests) would work.

I have reached Unit 4 of the Unit Testing and its fundamentals;
I have downloaded your sample code;
I have navigated to the root folder and run “npm install”
There were a lot of errors about different classes etc. being deprecated.
When I run “ng test” I received the following error:
“No projects support the ‘test’ target.”

Please help.
I could send you the log which will evidence the warnings etc.

Thanks

Dave

1 Like

Hello? No replies, yet some people have viewed this posting…

This problem has come up many times. See this for one of many ways to get testing working again: SOLUTION: How to get Angular Unit Testing to run ng test