Code Monkey home page Code Monkey logo

shields-tests's Introduction

shields-tests

Experimental test suite for Shields.

Features

Test vendor services, take 2

These tests use IcedFrisby, Joi (which is bundled with IcedFrisby), Nock, and a plugin that adds an .intercept() method, for concise nock support within IcedFrisby.

Create a shields symlink in the root of the project.

Then, to run the tests:

npm run test:vendor-take-2

Depends on:

Also depends on these two PRs in IcedFrisby:

Test vendor services

These tests use Nock Back.

By default, this test uses recorded http calls, allow additional http calls, and doesn't record anything. It's useful for developing new tests.

SHIELDS_DIR=/path/to/shields npm run test:vendor

There is a bug it seems, that prevents this from working correctly when some fixtures are already recorded for the same hostname. To work around that, delete fixtures.json and try again.

When you have written your tests, record the http calls:

NOCK_BACK_MODE=record SHIELDS_DIR=/path/to/shields npm run test:vendor

Then you can run them in "lockdown" mode, which will use the recorded calls and raise errors for any unexpected calls.

NOCK_BACK_MODE=lockdown SHIELDS_DIR=/path/to/shields npm run test:vendor

Pro tip: To run a single it or describe, change to it.only or describe.only.

Generate coverage reports

SHIELDS_DIR=/path/to/shields npm run test:vendor:coverage
opn coverage/lcov-report/index.html

Test that the service endpoints in try.html return valid SVG

SHIELDS_DIR=/path/to/shields npm run test:basic

Note: This test will hit all the external services.

Developer convenience

Start a shields server on port 1111:

SHIELDS_DIR/path/to/shields npm run start

Pro tip: If you're developing regularly, set SHIELDS_DIR in your shell startup files.

License

This project is in the public domain.

shields-tests's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.