AngularJS Test Example [closed] - unit-testing

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I don't know why but I'm finding it really difficult to get my head around setting up a JavaScript test using AngularJS.
I have my app.js, controller.js plus a number of other files for Ajax, Storage services, filters etc. My app works fine but I want to learn how to do E2E and unit testing.
I think I need to create a standalone HTML page that runs my tests, but I'm not sure, I'm also not sure which extra JavaScript files/libraries I might need.
Is there an AngularJS test example I could use to get the initial set-up?
Ideally I'd like to run the JS tests I create from within Visual Studio 2012...but that's a nice to have!

I find this tutorial a good start.
http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-testacular.html
It not only teaches how to do unit testing but also E2E and a special one ...Midway testing. A good reference IMHO.

I recomend you to look at angular-seed project.
It has e2e test already setup.
https://github.com/angular/angular-seed

AngularJS dev guide has a complete page on the subject:
http://docs.angularjs.org/guide/unit-testing
There is also a blog post mentioning a sample app in github including Testacular tests here:
http://blog.angularjs.org/2012/11/angularjs-example-applications.html
Hope it helps.

Angular Test Patterns is worth looking into as well. There are examples in both CoffeeScript and JavaScript for testing Controllers, Services, Directives and Filters. As well as ideas on how to use Mocks, End-to-End tests etc.

Related

I’m an iOS developer and want to learn Ionic 2, what should I do first? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm an iOS developer who have been using objective-c for two years.
Now situation is that I should build a shopping mall app in three months and it should be a hybrid app.
I googled for a while and everything tell me that Ionic 2 is the way I should go.
Problem is that I know nothing about JS, AngularJS, and node.js.
I know basic HTML and CSS.
Here's my plan.
Learn basic JS(ES6 or Typescript?) for half month.
Learn AngularJS for half month.
Learn node.js for half month.
Build app for one and half month.
The app I should make is not very complicated and not a huge project either.
If I build the app with native iOS code, it will take about a month.
My question is
Do you guys think the above plan is realizable?
If my plan looks wrong, then where should I start from?
I hope somebody who has similar background as mine would guide me, however, anyone please advice me.
Well, this is a tough question to answer, since it might be very individual.
You will certainly need to learn and gain some HTML and CSS skills since they define the way your app will look like.
However, Ionic 2 is based on Angular 2 which uses TypeScript as the main "language".
I added "" since TypeScript is a type-based language, which is actually very similar to Java or other OOP languages in it's syntax, and is transpiled into javascript.
In my opinion, in contrary to Angular 1.x, Angular 2 is much easier to learn and implement. The official tutorial is great.
The main disadventage though is that it is a pretty new platform (and the community is relatively small but growing).
Altough it is based on TypeScript, I do advice you to gain some basic JS skills, since you might find yourself need them at some point.
Regarding node.js - choosing Ionic as your front-end technlogy does not restrict you to work with JS based server-side platform.
It is a pretty quick platform to implement and learn, but if you are familiar with other server-side platforms you are free to work with them, since Angular 2 consumes RESTful services.
I would deffinetly start from playing around with Angular 2.0, only when you feel comfortable enough, you can move to Ionic.

Unit testing SuiteScripts and NetSuite Workflows in NetSuite [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I was looking for the options on how to unit test NetSuite SuiteScripts and workflows? Is there any framework for that??
I have used mochajs and chaijs for writing unit tests in NetSuite.
The library needs to be modified a bit as there are some async APIs which won't run in NetSuite.
I have pushed my code on github
You can take a look.
To test a workflow (assuming it runs after a record update/create), you can create/update the record in your unit tests and then write your expectations/assertions after create/update statements
You can unit test your javascript with a js testing framework like QUnit: qunitjs.com
While it wont mock nlapi calls, the rest of your javascript, if structured properly, can be tested with QUnit.
We use this for testing our javascript Netsuite modules.
I dont think anything for unit testing is there in NetSuite.
You can use the debugger to check the RESTlets, Suitelets, UserEvents , Portlets.
For Workflow, you need run it where condition is met and the workflow runs as expected
Yes, Nitish is right. Net suite doesn't have any unit testing functionality like other frameworks do. You can either use the netsuite debugger or manually you have to check the execution log in order to get the stack trace.
you can use log method
nlapiLogExecution(type,title,detail) for tracing . But I prefer netsuite Debugger.

Django/MongoDB tutorials for beginner [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm a beginner and don't have any prior experience with web application development. So far, I only did some CLI programming. Could anyone suggest me how to start working with Django and MongoDB?
There is a free education courses for MongoDB, one being developer-foccussed and the other more administration-focussed. There is still time to sign up afaik so I'd recommend having a look at the developer course (it's taught by Dwight Merriman, the 10gen CEO).
MongoDB tutorials can be found here.
There's a short doc on using MongoEngine with Django. The MongoEngine maintainer wrote a tutorial here on writing an app with MongoEngine and Django.
When you want to learn web application development, you should first learn how to create static HTML pages with a text editor, so you get a feeling for how the WWW actually works.
When you have a solid understanding of HTML and CSS, you can start with dynamic website generation using Django.
Using a database like MongoDB is an entirely different beast you should tackle after you've learned how to generate websites server-sided.

List of freely available online web-developer tools [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
What free, online tools does a web developer has at his disposal and "should know about"?
To set the spirit of the list, here are some examples:
Google Code playground
jsFiddle
Snipt
CSS Validation Service
Pastie
CodePad
Ideone
JS Bin
JSLint
CSSDESK
Visual jQuery
I think a good list could come in very handy for many!
Whilst you probably want to automate this on your server, I still find jscompress.com handy to minify or pack scripts.
Some others...
CSS Sprite Generator
CSS Border Radius
CSS Gradient Generator
(there are tonnes).
Yahoo has a number of good tools. The YUI material alone is fantastic.
I've found Chrome's Developer Tools (Ctrl+Shift+I) to be absolutely indispensable when debugging HTML, CSS, and JavaScript.
Fiddler is a fantastic tool to spy on (and fiddle with) the traffic your browsers (and other HTTP-connecting applications) are sending.
Aptana is great as a HTML/CSS/JavaScript IDE, complete with red sqigglies for syntax errors and intellisense/autocomplete. (You'll never use Notepad again.)
jQAPI is a really zippy version of the jQuery documentation.
I find yUML an invaluable tool to create diagrams online!
For PHP development I always use the FREE phpDesigner 2007 (Personal). It can debug PHP with single step trace and breakpoints. It's also a good editor for CSS, HTML, Javascript, XML etc...
(look under "older downloads" at the bottom).
Bubble supports create mind-mapping diagram online. I use it to organize general idea about the application.

Where can I find good unit testing resources for EJB and J2EE? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Which online resources, tutorials or books can you recommended to get started with unit testing J2EE / EJB3 applications?
So far I have found ejb3unit, Jakarta Cactus (retired 2011/08) and the Maven Cargo plugin. It would be helpful if there are complete working examples, ready to run.
Target containers are the open source products GlassFish, JBoss and Apache OpenEJB.
EJB Unit Testing with Eclipse and OpenEJB
Article on Testing EJB
Glassfish EJB 3.0 Unit testing
JUnitEE Tutorial
Effective Unit Testing EJB 3.0 with OpenEJB
JUnitEE IBM Tutorial
The next version NetBeans 6.8 includes a nice new feature: it generates Unit-Tests for EJB 3.1 with Embeddable Container code.
#Test
public void testHello() throws Exception {
System.out.println("hello");
HelloService instance = (HelloService)javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/HelloService");
String expResult = "";
String result = instance.hello();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
EJB out-of-container testing by Erwann "Airone" Wernli
JSFUnit is "a test framework for JSF applications. It is designed to allow complete integration testing and unit testing of JSF applications using a simplified API. JSFUnit tests run inside the container, which provides the developer full access to managed beans, the FacesContext, EL Expressions, and the internal JSF component tree. At the same time, you also have access to parsed HTML output of each client request."
There is nice book on TDD written by Lasse Koskela
It has a free to download web extra based on EJB testing.Grab it and roll up your sleeves.