angular-university / angular-testing-course Goto Github PK
View Code? Open in Web Editor NEWAngular Testing Course - A complete guide to Angular Unit Testing and E2E Testing
License: MIT License
Angular Testing Course - A complete guide to Angular Unit Testing and E2E Testing
License: MIT License
I am using windows 10, node 16.13.2, npm 8.1.2, angular-cli 13.0.4.
I saw 13 problems, why is that?:
[{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "'mat-tab-group' is not a known element:\n1. If 'mat-tab-group' is an Angular component, then verify that it is part of this module.\n2. If 'mat-tab-group' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.",
"source": "ng",
"startLineNumber": 5,
"startColumn": 3,
"endLineNumber": 34,
"endColumn": 19
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Property binding ngIf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".",
"source": "ng",
"startLineNumber": 8,
"startColumn": 5,
"endLineNumber": 18,
"endColumn": 20
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Can't bind to 'ngIf' since it isn't a known property of 'ng-container'.\n1. If 'ngIf' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.",
"source": "ng",
"startLineNumber": 8,
"startColumn": 19,
"endLineNumber": 8,
"endColumn": 72
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "The pipe 'async' could not be found",
"source": "ng",
"startLineNumber": 8,
"startColumn": 20,
"endLineNumber": 8,
"endColumn": 44
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "'mat-tab' is not a known element:\n1. If 'mat-tab' is an Angular component, then verify that it is part of this module.\n2. If 'mat-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.",
"source": "ng",
"startLineNumber": 10,
"startColumn": 7,
"endLineNumber": 16,
"endColumn": 17
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Property binding ngIf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".",
"source": "ng",
"startLineNumber": 10,
"startColumn": 7,
"endLineNumber": 16,
"endColumn": 17
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Can't bind to 'ngIf' since it isn't a known property of 'mat-tab'.\n1. If 'mat-tab' is an Angular component and it has 'ngIf' input, then verify that it is part of this module.\n2. If 'mat-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.",
"source": "ng",
"startLineNumber": 10,
"startColumn": 34,
"endLineNumber": 10,
"endColumn": 69
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Property binding ngIf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".",
"source": "ng",
"startLineNumber": 21,
"startColumn": 5,
"endLineNumber": 32,
"endColumn": 20
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Can't bind to 'ngIf' since it isn't a known property of 'ng-container'.\n1. If 'ngIf' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.\n2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.",
"source": "ng",
"startLineNumber": 21,
"startColumn": 19,
"endLineNumber": 21,
"endColumn": 72
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "The pipe 'async' could not be found",
"source": "ng",
"startLineNumber": 21,
"startColumn": 20,
"endLineNumber": 21,
"endColumn": 44
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "'mat-tab' is not a known element:\n1. If 'mat-tab' is an Angular component, then verify that it is part of this module.\n2. If 'mat-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.",
"source": "ng",
"startLineNumber": 23,
"startColumn": 7,
"endLineNumber": 30,
"endColumn": 17
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Property binding ngIf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the \"@NgModule.declarations\".",
"source": "ng",
"startLineNumber": 23,
"startColumn": 7,
"endLineNumber": 30,
"endColumn": 17
},{
"resource": "/c:/Udemy/angular-testing-course/src/app/courses/home/home.component.html",
"owner": "_generated_diagnostic_collection_name_#3",
"severity": 8,
"message": "Can't bind to 'ngIf' since it isn't a known property of 'mat-tab'.\n1. If 'mat-tab' is an Angular component and it has 'ngIf' input, then verify that it is part of this module.\n2. If 'mat-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\n3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.",
"source": "ng",
"startLineNumber": 23,
"startColumn": 33,
"endLineNumber": 23,
"endColumn": 68
}]
I pulled the codebase down this morning to try and resolve my project which I started earlier this year but ran into the problem with npm install.
Are you going to fix this?
angular-testing-course-master]$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/tslint
npm ERR! dev tslint@"~6.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer tslint@"^3.9.0" from [email protected]
npm ERR! node_modules/codelyzer
npm ERR! dev codelyzer@"^0.0.28" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/tslint
npm ERR! peer tslint@"^3.9.0" from [email protected]
npm ERR! node_modules/codelyzer
npm ERR! dev codelyzer@"^0.0.28" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/userme/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/userme/.npm/_logs/2022-10-27T13_38_08_457Z-debug-0.log
angular-testing-course-master$
Hello. I saw the following TS error after cloning the repo, checking out the branch, then running npm ci, npm audit fix, and then npm run server. npm start worked fine to compile the angular code, though.
Users-MacBook-Pro% npm run server
[email protected] server
ts-node -P ./server/server.tsconfig.json ./server/server.ts
/Users/user/coding/angular-testing-course/node_modules/ts-node/src/index.ts:307
throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
^
TSError: ⨯ Unable to compile TypeScript
server/search-lessons.route.ts (17,33): Argument of type 'string | ParsedQs | string[] | ParsedQs[]' is not assignable to parameter of type 'string'.
Type 'ParsedQs' is not assignable to type 'string'. (2345)
server/search-lessons.route.ts (18,31): Argument of type 'string | ParsedQs | string[] | ParsedQs[]' is not assignable to parameter of type 'string'. (2345)
server/search-lessons.route.ts (20,59): This condition will always return 'false' since the types 'number' and 'string | ParsedQs | string[] | ParsedQs[]' have no overlap. (2367)
server/search-lessons.route.ts (23,97): Property 'toLowerCase' does not exist on type 'string | ParsedQs | string[] | ParsedQs[]'.
Hi, when I am changing the expected values inside of the subscribe for findAllCourses
, like the one found here: https://github.com/angular-university/angular-testing-course/blob/1-finished/src/app/courses/services/courses.services.spec.ts#L37, I don't see any failures happening. I am wanting to see it fail if I change the length from 12 to 11. Why would this not be picking up the failure?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.