JavaScript Testing

Mark Ethan Trostler conducts a tutorial on getting started with JavaScript testing.

How to architect your app so the JS can be tested. A good lesson in some sound design principles not just for JavaScript.

  • Redis is a database / storage option.┬áRedis stores everything as a string (the protocol is text-based). Redis is accessed via a binding in Node.js.
  • Amazon S3 is a storage / database solution.
  • No object should be forced to depend on methods it doesn’t need.
  • Keep Different Functionality Separate.
  • Video shows an example of a JavaScript interface and implementation.
Advertisements

JavaScript Performance Tuning Secrets

Peter Flynn Performance Tuning Secrets (JavaScript)

 

Overviews Chrome tools to measure JavaScript speed / latency etc. USeful to know these tools exist even if I cant see a need to use them anytime soon.

A Word on Jenkins

I recently had difficulty getting jenkins configured on Windows 7.

Some things to keep in mind:

  • Although you may be logged in to the machine as Administrator, Jenkins probably isnt therefore make sure to have all environment variables included on the path for all users. If you dont do this, some of the tasks in the build may fail and give ambigious output.
  • Restarting Jenkins is done from hitting the following URL http://yourIPaddress:PORT/safeRestart
  • In the job, go to the configuration screen. APP.DIR is the absolute path to he directory, APP.BASE is the path from the folder of your app.
  • If you force the closing / ending of the Jenkins java process to forcefully kill it, you can restart by typing ‘Services’ in the start menu, locating Jenkins, right click and start.
  • Jenkins build will fail as soon as a task fails. For me, the last task was to start Chrome and this was failing. The solution was to uninstall one of the installations of chrome (not the one that Jenkins was looking for!)

Deploy App outside of htdocs for Apache

The Apache Web Server usually requires that you deploy applications in the htdocs directory. Hwever, sometimes it is useful to have Apache point to a different location on your file system, for example a ‘dist’ folder. To do this, make the following two entries in the http.conf file:

  1. Alias /my-desired-url C:/myapp/dist

  2. <Directory “C:/myapp/dist”>
    #
    # Possible values for the Options directive are “None”, “All”,
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that “MultiViews” must be named *explicitly* — “Options All”
    # doesn’t give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

    </Directory>

Apache Web Server – stop, start, restart

In the bin directory:

 

httpd.exe -k shutdown

httpd.exe -k restart