I've used rake tasks in my ruby on rails work in the past, and I'm wondering if the node.js framework express has anything similar. Basically, something that loads the environment and lets you execute scripts.
Have you heard of Jake?
Jake is a JavaScript build program for Node.js, with capabilities similar to GNU Make or Ruby's Rake. If you've ever built projects with Rake, you'll be very at home using Jake
Related
I have been using Selenium, Testng, Java, Maven to automate browser and I know these compliment each other. We can use one tool's method (APIs) in with other.
Now I have to automate using Nightwatch.js. During its initial setup I was asked to install node.js, but never got to know that why I need it? Why an installation of Nightwatch.js itself not enough?
I have tried to find out on Nightwatch's official page, but couldn't find out. Seems I am asking a very basic, foundation level question.
In a Nutshell:
NodeJS is a Javascript runtime that runs on the server. It is built on V8, Google's Javascript engine. This is the equivalent of the JVM and the Java Platform.
npm is a very popular package manager for the Javascript world and it is tighly integrated with Node. This is probably on the npm repositories that you will download Nightwatch.js. This is the package manager part of Maven for Javascript.
Nightwatch.js is a Node library that wraps Selenium for use in a Javascript environment. It is also a test runner, like JUnit or TestNG are for Java.
Hope this helps.
Is there any other server side language (with or without frameworks) that support hot-reload or live-coding, so when we develop, all we need is:
Start the web server
Edit the source code
Try on the browser (without having to restart the server)
Similar to PHP
Some other language that I know able to do this:
ruby/sinatra
sinatra-reloader gem (sometimes not working)
rerun (*
nodejs
nodules module
node-supervisor module
nodemon (*
(* automatically restart server when there are changes, not really hot-reload
Is there any other language that are able to do this? and if possible, showing the error (filename and line number, or the full stack trace) on the browser (not in the terminal/console), so I don't have to switch from code-editor then to browser and then to console to see the error.
You can try Perl with the Mojolicious framework: http://mojolicio.us/ (using the morbo server).
Can also be achived with Groovy/Java using the Grails framework: http://grails.org
You can use Erlang to work as a web server, which is designed to allow you to hot swap whole modules of code while the program is up and running. Though, the functional programming paradigm does take a little while to get used to...
How to write a simple webserver in Erlang?
I hope this helps...
I think what you ask for is actually called live-reload, hot-reload is something I believe only Erlang can truly accomplish.
By configuring and adding plugins to Grunt or Gulp, you can watch for changes in any list / kinds of files and describe any action to be initiated. Here is a plugin for Grunt. With this method, any language can gain such ability.
As a side note, Django (Python) has auto-restart as well. But that does not mean Python language has it built-in, Django uses a Grunt-like trick to restart its dev-server.
Revel for Go could do this, or Beego, the difference is Revel only recompile when there are changes on the source code and on new request (so it's more efficient), Beego recompile every time there are source code changes.
EDIT: Beego 1.3.0 remove its hot reload feature T__T
I'd like to make my Node projects a bit more idiomatic, making use of popular Node technologies like grunt. How should I rewrite my dependent shell tasks in my Makefiles in something like Gruntfile.js? There doesn't seem to be clear documentation on how to do this.
Is there another Node build technology I should be using? I would just write one-liner scripts in package.json, but npm doesn't have a way to specity that tasks dependent on one another.
Everything in grunt are tasks. You can use a task like grunt-shell to run your shell commands.
There's an open ticket for better docs about this.
I'm quite new to testing in javascript, where I work, we us node.js for our projects.
I finished one of our projects, but I only used manual testing.
I need to develop my testing skill and I dont know how to improve it.
I need any testing tool to run my node.js projects, could you please tell me how to improve and learn new testing skills?
Look at Mocha test framework. I think this is the best choose for testing node.js applications at this moment.
If you are using Node to develop a web application you could use one of the headless browsers to test the user interaction (along with ajax) there are PhantomJS and Zombie for example.
Look around in Node Toolbox you'll find many frameworks and utilities to create your tests.
This is a good overview on some of the different unit test tools for Node.js:
3 Quick Tips for Writing Tests in Node.Js (after some rambling)
I'm looking for something like the HTML5 boilerplate build script, but for node.js/express server.
Any such thing?
Thanks.
Why not just use ant build manually?
You can hook that into your IDE or you can hook it into forever or supervisor so that it builds before it restarts. And by hook I mean fork the source code and do it yourself.
What exactly do you expect express/node to automate for you?