Learn Angular SitePoint Book Series

I have been learning Angular, and just downloaded SitePoint’s Learn Angular Book Series. I am working through the second book: Build a Todo App.

I am at the stage where I use ng generate class Todo --spec to generate a class Todo which is supposed to end up in src/app. But mine ended up in e2e/app and I have never run across how the e2e folder is used in all the tutorials and courses I have tried.

My question - why was the class not placed in the src/app folder? And if I make adjustments to the tutorial, will the app still work if I leave it in the e2e/app folder, or should I move it manually to src/app?

I am using Angular 6.0.6 and Node 8.9.1.

The e2e folder is where the end-to-end tests live. In Angular these are normally done using Protractor, but there’s no reason you couldn’t use a different library, such as Cypress. Either way, end-to-end tests ensure that your app functions correctly as a whole. They do this by firing up a browser (either a real one or headless) and allowing you to make assertions against your app — for example if a user can login, if your dynamic search functions correctly, etc…

I have no idea how you managed to generate the files in the e2e folder (I just tried to reproduce that, but couldn’t), but I’m pretty sure that things will not work as expected if you leave them there. If I was you, I’d delete them, then try generating them again and if the CLI insists on creating them there, move them over by hand.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.