Skip to content

Showing optimistic render and tests using Hoplon and Castra

Notifications You must be signed in to change notification settings

mynomoto/hoplon-tops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hoplon-tops

A Hoplon project with Castra designed to show optmistic render on the client side while asynchronously calling the server for validation. This project also has tests using purnam.test and double-check, which are run on Karma.

The client pools the server each second for a random word and shows the last 10 words. The user can submit new words, which will appear on the list immediately and submited to the server.

The server has an artificial delay of 2 seconds before returning a response. If the word has more than 6 characteres the server will tell that is a invalid word and the client will show in a different manner valid and invalid words.

Dependencies

Usage

  1. Start the auto-compiler. In a terminal:

    $ boot dev
  2. Go to http://localhost:8000 in your browser.

Testing

You need to install karma and some plugins before running the tests. In a terminal:

npm install karma karma-jasmine karma-chrome-launcher karma-firefox-launcher

You should also install karma-cli because it makes your life easier. In a terminal (you may need sudo):

npm install -g karma-cli

Now to run the tests:

  1. Start the auto-compiler. In a terminal:

    $ boot test
  2. Start the karma runner. In another terminal:

    $ karma start
  3. When you save a file, hoplon will auto compile and then karma will auto run the tests.

License

Copyright © 2014, Marcelo Nomoto. All rights reserved.

The use and distribution terms for this software are covered by the Eclipse
Public License 1.0 (http://opensource.org/licenses/EPL-1.0) which can
be found in the file epl-v10.html at the root of this distribution. By using
this software in any fashion, you are agreeing to be bound by the terms of
this license. You must not remove this notice, or any other, from this software.

About

Showing optimistic render and tests using Hoplon and Castra

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published