All Projects → gbochenek → wab-test-example

gbochenek / wab-test-example

Licence: other
ESRI Web App Builder Widget built using a wrapped widget convention and containing unit tests. This widget is meant to be used as an example to demonstrate the two techniques.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to wab-test-example

EntityFrameworkCore.AutoFixture
A library aimed to minimize the boilerplate required to unit-test Entity Framework Core code using AutoFixture and in-memory providers.
Stars: ✭ 31 (+47.62%)
Mutual labels:  unit-testing
Tablier
A micro-framework for Table Driven Tests.
Stars: ✭ 33 (+57.14%)
Mutual labels:  unit-testing
morq
BDD/TDD assertion interface
Stars: ✭ 80 (+280.95%)
Mutual labels:  unit-testing
UTBotCpp
Tool that generates unit test by C/C++ source code, trying to reach all branches and maximize code coverage
Stars: ✭ 59 (+180.95%)
Mutual labels:  unit-testing
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (+57.14%)
Mutual labels:  unit-testing
pythonista-chromeless
Serverless selenium which dynamically execute any given code.
Stars: ✭ 31 (+47.62%)
Mutual labels:  unit-testing
unitizer
Easy R Unit Tests
Stars: ✭ 38 (+80.95%)
Mutual labels:  unit-testing
bitrix-module-bunit
BUnit - фреймворк модульного тестрования для CMS Bitrix
Stars: ✭ 20 (-4.76%)
Mutual labels:  unit-testing
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕
Stars: ✭ 409 (+1847.62%)
Mutual labels:  unit-testing
FRUITPy
Python interface for the FRUIT Fortran unit testing framework
Stars: ✭ 39 (+85.71%)
Mutual labels:  unit-testing
dumbmutate
Simple mutation-testing
Stars: ✭ 32 (+52.38%)
Mutual labels:  unit-testing
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+642.86%)
Mutual labels:  unit-testing
the-art-of-unit-testing
Repository that contains code in Node.js from the book The Art of Unit Testing, Second Edition by Roy Osherove
Stars: ✭ 22 (+4.76%)
Mutual labels:  unit-testing
jasmine-styleguide
Suggested best practices when writing Jasmine unit tests.
Stars: ✭ 65 (+209.52%)
Mutual labels:  unit-testing
pytest
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
Stars: ✭ 9,731 (+46238.1%)
Mutual labels:  unit-testing
toster
DSL framework for testing Android apps
Stars: ✭ 31 (+47.62%)
Mutual labels:  unit-testing
Restaurants
Restaurants sample app built with the new architecture components (LiveData, Room, ViewModel) and Dagger 2
Stars: ✭ 47 (+123.81%)
Mutual labels:  unit-testing
babel-plugin-rewire-exports
Babel plugin for stubbing [ES6, ES2015] module exports
Stars: ✭ 62 (+195.24%)
Mutual labels:  unit-testing
sketch-test-inspector
Helper utils and plugin for running unit tests on sketch plugins
Stars: ✭ 18 (-14.29%)
Mutual labels:  unit-testing
helloworld
Boilerplate code for basic architecture of an android application following MVVM pattern using hilt, RxJava2.
Stars: ✭ 26 (+23.81%)
Mutual labels:  unit-testing

wab-test-example

This repository contains a sample ESRI Web App Builder widget which takes the user to Dev Summit.

The widget is a seperately wrapped JSAPI widget written with unit tests for test driven development. It was origanally scaffolded out using the ESRI Web App Builder Yeoman Generator (https://github.com/Esri/generator-esri-appbuilder-js) with ES2015 syntax enabled.

Wrapping your widgets

Wrapping JSAPI widgets within the Web App Builder framework is a powerful way to increase your widget's portability and reduce complexity. The code within widgets/GoToDevSummit/Widget is minimal and only serves to pass Web App Builder events and properties on to the widget itself (which is located in widgets/GoToDevSummit/GoToDevSummit).

Unit Tests and Test Driven Development

The number one rule for writing good unit tests is to avoid testing other people's code. Doing so will keep your tests easy to write. If tests aren't easy to write, they will nont get written.

Wrapping a JSAPI widget instead of writing a widget inside Widget.js helps to achieve this principal, since we don't even load Web App Builder libraries during testing.

In order to avoid testing the ESRI JavaScript API, we use SinonJS (in this example) to mock any JSAPI classes or methods. Instead of testing if the view has actually navigated to Palm Springs, we're testing that the SceneView's goTo function was called with the correct parameters.

Running Tests

To run this application's unit tests, clone this repo and run the following commands:

  1. npm install
  2. grunt test

For steps on syncing this application with your Web App Builder for Developers installation, see the documentated Grunt tasks in the ESRI Web App Builder Yeoman Generator (https://github.com/Esri/generator-esri-appbuilder-js)

Technology Choices

This application was writting using Karma(https://karma-runner.github.io/2.0/index.html) as a test runner, Jasmine (https://jasmine.github.io/) as an assertion language, and the Grunt task runner (https://gruntjs.com/getting-started) to pull it all together. However, the principals applied are not technology specific and this application can be modified to use your technology of choice.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].