UNPKG

kazana-example

Version:
92 lines (65 loc) • 2.76 kB
# kazana-example > Kazana example app [![NPM version](https://badge.fury.io/js/kazana-example.svg)](https://www.npmjs.com/package/kazana-example) [![Build Status](https://travis-ci.org/eHealthAfrica/kazana-example.svg?branch=master)](https://travis-ci.org/eHealthAfrica/kazana-example) Simple Kazana application with a [static index.html](public/index.html) to submit income / expenses trough a free text for, which then gets transformed into separate balance movement data, and indexed by category. ### Setup ``` git clone git@github.com:eHealthAfrica/kazana-example.git cd kazana-example npm install npm start ``` If you want to use this repository as the base for your own Kazana app, simply reset the git history ``` rm -rf .git ``` ## Test [![Dependency Status](https://david-dm.org/eHealthAfrica/kazana-example.svg)](https://david-dm.org/eHealthAfrica/kazana-example) [![devDependency Status](https://david-dm.org/eHealthAfrica/kazana-example/dev-status.svg)](https://david-dm.org/eHealthAfrica/kazana-example#info=devDependencies) ### Test setup You need to run the test setup **once** on a fresh install: ```sh npm run test:setup ``` ### Run the tests The test suite is initiated by issuing the following command: ```sh npm test ``` You can also run a single test file directly with node: ```sh kazana_config=test/kazanarc node test/integration/basic-test.js ``` ### Authoring Tests Integration tests are done via [tap](http://node-tap.org/), driven by [webdriver.io](http://webdriver.io/) and run against [Selenium](http://www.seleniumhq.org/). Webdriver is configured to connect either to [Sauce Labs](http://saucelabs.com/) or a local Selenium server. It decides so based on the existence of two environment variables: `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY`. On Travis those variables are configured. In the other case the testsuite starts a selenium server. Each integration test requires `test/utils/integration`, which starts the app, cleans the database, starts the Webdriver client and provides a `tap.test` interface. This means that every integration test file runs in isolation and can in theory be run in parallel. Per default an in-memory PouchDB server is used. That way a CouchDB is not needed for running the tests. However, a real Couch can be configured via environment variables: ```sh kazana_kazana__backend__name=couchdb \ kazana_kazana__backend__location=http://localhost:5984 \ npm test ``` There are some custom Webdriver commands for login and uploading; they are located in `test/utils/commands`. Happy Testing :rocket: ## Credit Brought to you by [eHealth Africa](http://ehealthafrica.org/) — good tech for hard places. ## License [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)