kernicPanel
23.1K views | +0 today
kernicPanel
JavaScript, Node Js, Git, Vim, and more…
Curated by Nicolas Clerc
Your new post is loading...
Your new post is loading...
Rescooped by Nicolas Clerc from #CodeReview
Scoop.it!

Express.js 4, Node.js and MongoDB REST API Tutorial

Express.js 4, Node.js and MongoDB REST API Tutorial | kernicPanel | Scoop.it

ere’s a brand new, revisited tutorial for Express.js 4, Node.js and MongoDB (Mongoskin) free-JSON RESTful API server.

Contents:

Node.js and MongoDB REST API OverviewREST API Tests with Mocha and SuperagentNPM-ing Node.js Server DependenciesExpress.js 4.x Middleware CaveatExpress.js and MongoDB (Mongoskin) ImplementationRunning The Express.js 4 App and Testing MongoDB Data with MochaConclusion and Further Express.js and Node.js Reading 

This Node.js, Express.js and MongoDB (Mongoskin) tutorial will walk you through writing the test using the Mocha and Super Agent libraries. This is needed for a test-driven development building of a Node.js free JSON REST API server.

The server application itself will utilize Express.js 4.x framework and Mongoskin library for MongoDB. In this REST API server, we’ll perform create, read, update and delete (CRUD) operations and harness Express.js middleware concept with app.param() and app.use() methods.


Via Jan Hesse, Ex FromTheLeft
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Tutorial: JSON REST API server with Node.js and MongoDB using Mongoskin and Express.js | webapplog

Tutorial: building a JSON REST API server with Node.js and MongoDB using Mongoskin and Express.js utilizing Mocha and Super Agent for BDD/TDD.
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Writing Testable JavaScript

Writing Testable JavaScript | kernicPanel | Scoop.it
As our JavaScript takes on more and more responsibilities, we need a reliable codebase—one that is thoroughly tested.
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Test-Driven Node.js Development with Grunt - Mark Dalgleish

One of the great things about working in a Node.js environment is that it encourages you to break your work down into discrete modules. Separating your work into smaller files is a good first step, but publishing to npm is so simple that creating small modules for others to share is a great way to give back to the community.

When writing small modules that adhere to the Unix philosophy of small programs doing one thing well, writing in a test-driven manner is almost a no brainer. However, getting a new Node project up and running can be a tedious process, particularly if you’re new to Node.

Luckily, Ben Alman has created Grunt, a project which is fast becoming the build tool of choice for the JavaScript community.

more...
No comment yet.
Rescooped by Nicolas Clerc from mongodb-node
Scoop.it!

Manual Dependency Injection in JavaScript

Dependency injection (DI) is a pattern used to write modular, loosely coupled components. Specifically, you inject specific dependencies into a module at run-time rather then loading them in a hard...

Via nodejs-code
more...
No comment yet.
Rescooped by Nicolas Clerc from nodeJS and Web APIs
Scoop.it!

Home - Frisby.js

http://t.co/CqbmTdMs Frisby is a REST API testing framework built on node.js and Jasmine that makes testing API endpoints easy, fast and fun...

Via Srdjan Strbanovic
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Introduction To JavaScript Unit Testing | Smashing Coding

Introduction To JavaScript Unit Testing | Smashing Coding | kernicPanel | Scoop.it
You probably know that testing is good, but the first hurdle to overcome when trying to write unit tests for client-side code is the lack of any actual units; JavaScript code is written for each page of a website or each module of an application...
more...
No comment yet.
Rescooped by Nicolas Clerc from nodeJS and Web APIs
Scoop.it!

Integration Testing with Node.js - Journal - Simon Cousins: almost functioning

One of the joys of enterprise programming is working with legacy applications. Recently I had to u...

Via Srdjan Strbanovic
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Testing Private State and Mocking Dependencies - How To Node - NodeJS

During Christmas I've been working on SlimJim and found some tricks how to make my testing life easier. It's nothing special at all, just a simple way how to access private state of a module and how to mock out some dependencies. I've found these two techniques pretty usefull, so I believe it might help someone else as well...

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Continuous Integration for Javascript

Continuous Integration for Javascript | kernicPanel | Scoop.it

Jenkins is a CI tool that is often used for Running tests and code analysis for Java and .NET projects. There are a lot of benefits that we as a community are not taking advantage of for our web (CSS, JS, etc) code. In this article I’m going to walk you through setting up automated building and testing for a JavaScript project.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Unit testing in node.js

Node.js provides a its own assert module with some really useful functions for creating basic tests. However, the reporting and running of these assertions can become complicated, especially with asynchronous code. How can you be sure that all assertions ran? Or that they ran in the correct order? This is where nodeunit comes in, a tool for defining and running unit tests in the simplest way possible.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Nouveau regard sur les tests en Node.js avec Mocha, Should et Travis - Adaltas

Nouveau regard sur les tests en Node.js avec Mocha, Should et Travis - Adaltas | kernicPanel | Scoop.it
Aujourd’hui, j’ai finalement décidé de passer une peu de temps autour de Travis. Cette petite image verte en haut des pages d’accueil de projets GitHub m’intrigue de plus en plus ces derniers jours. En fait, pour être tout à fait honnête, ce n’est pas exactement ainsi que j’ai débuté ma soirée. Tout d’abord, après deux ans de bon et loyaux services, j’ai décidé d’abandonner Expresso pour donner une chance à Mocha. Et puisque je m’étais habitué aux quelques petites fonction dont Expresso enrichit le module assert, il m’a fallut y remédier, ce qui m’a conduit au module Should. Il me fut assez plaisant de voir comment ces deux derniers modules se complètent parfaitement l’un et l’autre, dans la plus pure tradition Unix: petit, puissant et bon citoyen.
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Running an Express server with Grunt and Yeoman: Part 3 | ar[V]elocity

Back in part 1 of this series I introduced a small number of tools that make a web engineer’s life easier: Grunt, Yeoman, Express, and Nodemon. In part 2 I provided a repository of filesand explained how to use them to have a running server that’s capable of automatic browser and app server reboots for rapid development.

 

Now, in part 3, I’ll explain how we can use this workflow to automatically run unit tests when development files or test files change, backend or frontend, and how to expose internal functions and properties in our Node or RequireJS modules to the testing environment so that we get less bugs. Onward!

more...
No comment yet.
Rescooped by Nicolas Clerc from Nodejs-code
Scoop.it!

Test-Driven Node.js Development with Grunt - Mark Dalgleish

One of the great things about working in a Node.js environment is that it encourages you to break your work down into discrete modules. Separating …

Via nodejs-code
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Testing Backbone + RequireJS Applications with Jasmine | Simple Thoughts

Testing Backbone + RequireJS Applications with Jasmine | Simple Thoughts | kernicPanel | Scoop.it
In my previous post, I covered the structure of a Backbone.js application using RequireJS.
The next thing (or if you are a TDD fan, the first thing) we do is to run some tests on it.
According to Coda Hale:

Writing tests for your code may not reduce the number of bugs, but it will make fixing the bugs you inevitably find easier.

Obviously, we can take advantage of the AMD architecture, to help us write modular tests (or “specs” in the BDD language).
To get a better sense of the challenges and different approaches in unit testing, I wrote the exact same tests three times using three different testing frameworks: Jasmine, Mocha and QUnit.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Testing in Node.js with Mocha - Brian Stoner

I recently migrated all of our server side Node tests at Instinct from Vows to Mocha.

I've been around the block with testing in Node, unable to find an approach that I really liked, until I started using Mocha. The elegant way it does async along with familiar BDD style syntax is really enjoyable to work with. It's made writing/maintaining our tests something I don't run from anymore.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

James Newbery: Testing your Backbone from the outside-in

A look at some strategies, tools and techniques for creating an 'outside-in' approach to testing and developing rich JavaScript applications, with an emphasis on Backbone.js.
In the world of dynamic, asynchronous, real-time client-server applications, testing is hard.
Fortunately, we already have the tools available to create full suites of functional, integration and unit tests, and use behavioural-driven design techniques to tease out a working implementation from the starting point of users' needs.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Gradle JavaScript Plugin, 1.0

Last week, I released version 1.0 of my JS Plugin for Gradle. It’s come a long way since its inception, and I wanted to explain what it does and where it’s headed in the future.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Testing your Backbone from the outside-in // Speaker Deck

In the world of dynamic, asynchronous, real-time client-server applications, testing is hard. Fortunately, we already have the tools available to create full suites of acceptance, integration and unit tests, and use behaviour-driven design (BDD) methodologies to tease out a working implementation from the starting point of users' needs.

more...
No comment yet.
Rescooped by Nicolas Clerc from nodeJS and Web APIs
Scoop.it!

A Simple Introduction to Behavior Driven Development in NodeJS with

I recently had a chance to get familiar with the Mocha test framework for NodeJS and wanted to provide a really simple introduction to it. Assuming you have node and npm installed, you'll want to install mocha as a global npm ...

Via Srdjan Strbanovic
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

3 Quick Tips for Writing Tests in Node.JS (after some rambling)

You are probably already aware of Node.JS, unless you've been living under a rock for the past year. It's a pretty ingenious project combining the extremely fast Google V8 JavaScript engine with a highly-optimized cross-platform asynchronous networking library (libuv). The next two paragraphs will be some rambling opinions on Node.JS coming from a Python and C hacker. Then we shall get down to writing tests.

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

Integration Testing with Node.js - Journal - Simon Cousins: almost functioning

One of the joys of enterprise programming is working with legacy applications. Recently I had to update a legacy application to reflect some changes to a third party HTTP API that it relied upon. The third party had published the API specifications but, as is often the case, did not provide an implementation to perform integration tests against. So, I needed to implement a stub for the HTTP API that, in addition to handling the functional API calls, would also have to handle the session management cookies dictated by the specifications.
more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

CasperJS, a toolkit on top of PhantomJS | Code | Nicolas Perriault

It's been quite a while since I posted about the awesomeness of PhantomJS, the scriptable headless WebKit with JavaScript API.

In the meanwhile, I started coding a tiny lib to ease the creation of PhantomJS scripts, especially navigation scenarios.

Six months later, the lib has gained many more features and is now an entire project on its own; 

more...
No comment yet.
Scooped by Nicolas Clerc
Scoop.it!

BDD Testing with Jasmine, node.js and socket.io

Over the last couple of weeks I have been working on a new real-time web architecture for mobile: backbone-live based on the Tic-Tac-Node game example. This week will be publishing backbone-live experimental version to the npm. In putting this library together, the Loku team wanted to take a Behavior Drive Development (BDD) approach from start-to-finish in building up this framework.
more...
No comment yet.