Giter Club home page Giter Club logo

felicity's Introduction

felicity

Felicity supports Joi schema management by providing 2 primary functions:

  1. Testing support - Felicity will leverage your Joi schema to generate randomized data directly from the schema. This can be used for database seeding or fuzz testing.
  2. Model management in source code - Felicity can additionally leverage your Joi schema to create constructor functions that contain immutable copies of the Joi schema as well as a simple .validate() method that will run Joi validation of the object instance values against the referenced Joi schema.

npm version Build Status Known Vulnerabilities

Lead Maintainer: Wes Tyler

Introduction

fe·lic·i·ty noun intense happiness; the ability to find appropriate expression for one's thoughts or intentions.

Felicity provides object instances, or expressions, of the data intentions represented by Joi schema.

Felicity builds upon Joi by allowing validation to be contained cleanly and nicely in constructors while also allowing easy example generation for documentation, tests, and more.

Installation

npm install felicity

Usage

Model Management

Given a joi schema, create an object Constructor and instantiate skeleton objects:

const Joi      = require('joi');
const Felicity = require('felicity');

const joiSchema = Joi.object().keys({
    key1: Joi.string().required(),
    key2: Joi.array().items(Joi.string().guid()).min(3).required(),
    key3: Joi.object().keys({
        innerKey: Joi.number()
    })
});

const FelicityModelConstructor = Felicity.entityFor(joiSchema);
const modelInstance = new FelicityModelConstructor({ key1: 'some value' });

console.log(modelInstance);
/*
{
    key1: 'some value',
    key2: [],
    key3: {
        innerKey: 0
    }
}
*/

These model instances can self-validate against the schema they were built upon:

modelInstance.key3.innerKey = 42;

const validationResult = modelInstance.validate(); // uses immutable copy of the Joi schema provided to `Felicity.entityFor()` above

console.log(validationResult);
/*
{
    success: false,
    errors : [
        {
            "message": "\"key2\" must contain at least 3 items",
            "path": [ "key2" ],
            "type": "array.min",
            "context": {
                "limit": 3,
                "value": [],
                "key": "key2",
                "label": "key2"
            }
        },
        // ...
    ]
}
*/

Testing Usage

Additionally, Felicity can be used to randomly generate valid examples from either your Felicity Models or directly from a Joi schema:

const randomModelValue = FelicityModelConstructor.example(); // built in by `Felicity.entityFor()`
/*
{
    key1: '2iwf8af2v4n',
    key2:[
        '077750a4-6e6d-4b74-84e2-cd34de80e95b',
        '1a8eb515-72f6-4007-aa73-a33cd4c9accb',
        'c9939d71-0790-417a-b615-6448ca95c30b'
    ],
    key3: { innerKey: 3.8538257114788257 }
}
*/

// directly from Joi schemas:
const stringSchema = Joi.string().pattern(/[a-c]{3}-[d-f]{3}-[0-9]{4}/);
const sampleString = Felicity.example(stringSchema);
// sampleString === 'caa-eff-5144'

const objectSchema = Joi.object().keys({
    id      : Joi.string().guid(),
    username: Joi.string().min(6).alphanum(),
    numbers : Joi.array().items(Joi.number().min(1))
});
const sampleObject = Felicity.example(objectSchema);
/*
sampleObject
{
    id: '0e740417-1708-4035-a495-6bccce560583',
    username: '4dKp2lHj',
    numbers: [ 1.0849635479971766 ]
}
*/

Node.js version compatibility

Please note that Felicity follows Node.js LTS support schedules as well as Joi Node.js version support.

Beginning with [email protected], only Node.js versions 12 and above will be supported.

API

For full usage documentation, see the API Reference.

Contributing

We love community and contributions! Please check out our guidelines before making any PRs.

Setting up for development

Getting yourself setup and bootstrapped is easy. Use the following commands after you clone down.

npm install && npm test

Joi features not yet supported

Some Joi schema options are not yet fully supported. Most unsupported features should not cause errors, but may be disregarded by Felicity or may result in behavior other than that documented in the Joi api.

A feature is considered Felicity-supported when it is explicitly covered in tests on both entityFor (and associated instance methods) and example.

  • Function
    • ref
  • Array
    • unique
  • Object
    • requiredKeys
    • optionalKeys

felicity's People

Contributors

peterwhitesell avatar phpstudyone avatar samueljoli avatar westyler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

felicity's Issues

Code Examples

Create /examples directory with several different use-cases. With test coverage.

Add `value` to validationObject

The validate method return object should include the value of the validated object with any applicable Joi type conversions, regardless of success/failure:

{
    success: true,
    errors : null,
    value  : {/*...*/}
}

Joi.object().pattern() is not supported. And it should be.

Context

  • node version: 6.9.0
  • felicity version: 1.1.1
  • environment (node, browser): node
  • any relevant modules used with (hapi, hoek, etc.): none

What are you trying to achieve or the steps to reproduce ?

Using the Joi schema Joi.object().pattern() should be supported in both .entityFor and .example methods.

const schema = Joi.object().pattern(/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/, Joi.object().keys({
    id  : Joi.string().guid().required(),
    tags: Joi.array().items(Joi.string()).required()
})).min(2);

const example = Felicity.example(schema);

What result did you expect ?

example
/*
{
    '4dffdb09-9e60-423d-b956-a9b821fb8fde': {
        id: '4dffdb09-9e60-423d-b956-a9b821fb8fde',
        tags: []
    },
    '3ad38506-3ef4-4e93-a745-023f8e8ccf75': {
        id: '3ad38506-3ef4-4e93-a745-023f8e8ccf75',
        tags: []
    }
}
*/

What result did you observe ?

Only the .min(2) is respected. Example fails validation.

example
/*
{
    wdgx: 'wdgx6obscdnbrtz9kldavpldi',
    ppfz: 'ppfzbv353bdllftgdzllq5mi'
}
*/

Examples[childSchema.type] is not a constructor

Context

  • node version: 7
  • felicity version: 2.1.0
  • environment: node
  • any other relevant information: using joi extensions

What are you trying to achieve or the steps to reproduce ?

I'm trying to generate an example from a joi schema. Something as simple as this

const Felicity = require('felicity');
const ProbeSchema = require('./path/to/schema');

console.log(Felicity.example(ProbeSchema));

But I'm getting the following error:

/node_modules/felicity/lib/helpers.js:615
                const child = new Examples[childSchema.type](childSchemaRaw, childOptions);

What result did you expect ?

I expect an auto generated example, of course 😄

What result did you observe ?

Instead I get an error.

I think this may be related with #80
Is felicity unable to generate examples from extended Joi instances?

Regards

Does not properly handle Joi alternatives

Using the Joi sample schema of:

let schema = Joi.object().keys({
    username: Joi.string().alphanum().min(3).max(30).required(),
    password: Joi.string().regex(/^[a-zA-Z0-9]{3,30}$/),
    access_token: [Joi.string(), Joi.number()],
    birthyear: Joi.number().integer().min(1900).max(2013),
    email: Joi.string().email()
}).with('username', 'birthyear').without('password', 'access_token');

Node returns:

> const felicityInstance = new Felicity.skeleton(schema);
TypeError: Cannot read property 'type' of undefined
    at childrenKeys.forEach (/Users/dhinkle/Work/felicity/lib/joiGenerator.js:47:37)
    at Array.forEach (native)
    at schemaMapper (/Users/dhinkle/Work/felicity/lib/joiGenerator.js:35:30)
    at skeleton.generate (/Users/dhinkle/Work/felicity/lib/joiGenerator.js:83:5)
    at new skeleton (/Users/dhinkle/Work/felicity/lib/index.js:13:18)
    at repl:1:26
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:313:29)

Track Joi support coverage

Just creating a place to track with Joi schema features we currently support.
A feature/option is "supported" when there are explicit tests in both Felicity.skeleton and Felicity.example.

Joi version: 9.0.4

  • Any
    • default
    • required
    • optional
    • valid
    • allow
    • strip
    • forbidden
  • String
    • guid
    • email
    • min
    • max
    • length
    • isoDate
    • regex
      • invert: true
    • insensitive
    • truncate
    • creditCard
    • replace
    • alphanum
    • token
    • ip
    • uri
    • uuid
    • hex
    • hostname
    • lowercase
    • uppercase
    • trim
  • Number
    • negative
    • positive
    • integer
    • min
    • max
    • greater
    • less
    • precision
    • multiple
  • Boolean
    • truthy
    • falsy
  • Buffer
    • encoding
    • min
    • max
    • length
  • Date
    • min
      • now
    • max
      • now
    • iso
    • timestamp
      • unix
    • format
  • Function
    • arity(1)
    • arity
    • minArity
    • maxArity
    • ref
  • Array
    • items
      • forbidden
    • sparse
    • ordered
    • min
    • max
    • length
    • single
    • unique
  • Alternatives
    • try
    • when
  • Object
    • keys
    • min
    • max
    • length
    • nand
    • xor
    • with
    • without
    • pattern
    • and
    • or
    • rename
    • unknown
    • type
    • schema
    • requiredKeys
    • optionalKeys

2.0.0 Release Notes

Summary

This release breaks previous return values from Felicity.example() for some combinations of Joi.number() schema.

  • Upgrade time: low
  • Complexity: low
  • Risk: low

Breaking changes

Felicity.example()

In v1, Felicity had hard-coded checks for "impossible" scenarios (like Joi.number().negative().min(1)), and would return NaN. Because of some bad mathematical assumptions in those hard-coded checks, some cases like Joi.number().negative().max(10) were considered "impossible" incorrectly.

Felicity now uses Joi.validate() inside of the example generation of numbers to determine "impossible" status. This means some examples that were previously (incorrectly) considered impossible will now return valid numbers.

Felicity.example(Joi.number().negative().max(10));
// OLD:
// NaN
// NEW:
// some psuedo-random negative number

Felicity.example(Joi.number().multiple(12).max(10));
// OLD:
// NaN
// NEW:
// 0

Problem with Joi.alternatives().try()

Context

  • node version: 6.9.0
  • felicity version: 1.2.0
  • environment (node, browser): node
  • any relevant modules used with (hapi, hoek, etc.): none

What are you trying to achieve or the steps to reproduce ?

const schema = Joi.object({
    alternative: Joi.alternatives().try(Joi.number().integer().min(1), Joi.string().guid().lowercase()).required()
});
const Document = Felicity.entityFor(schema);
const doc = new Document();
/* Error: Cannot read property 'type' of undefined 
      at childrenKeys.forEach (/[redacted]/felicity/lib/joiGenerator.js:72:33)
      at Array.forEach (native)
      at schemaMapper (/[redacted]/felicity/lib/joiGenerator.js:52:26)
      at Constructor.generate (/[redacted]/felicity/lib/joiGenerator.js:93:5)
      at new Constructor /[redacted]/felicity/lib/index.js:88:22)
*/

What result did you expect ?

The document should be instantiated with the alternative key set to null.

What result did you observe ?

Error: Cannot read property 'type' of undefined

Documentation around testing

We need some documentation around testing.

  • Any machine specific requirements
    • eg: mocha/chai
  • Command for entrypoint

Do not always use "valids" in .example

Currently, Felicity.example will always pick a random value from the valids array if present. This means that some schema that .allow(null) will always generate null.

const schema = Joi.object().keys({
    name: Joi.string().allow(null)
});
Felicity.example(schema); // always returns { name: null }

Instead, the code should only sometimes use valids unless flags.allowOnly is set in which case the current behavior is correct.

Joi.string().allow(null).describe();
// { type: 'string', valids: [ null ], invalids: [ '' ] }
Joi.string().valid('name').describe();
// { type: 'string', flags: { allowOnly: true }, valids: [ 'name' ], invalids: [ '' ] }

API.md does not accurate describe .validate behavior with a callback

Context

  • node version: 4.5.0
  • felicity version: 1.1.0
  • environment (node, browser): node

What are you trying to achieve or the steps to reproduce ?

To reproduce, create a constructor functions from a Joi schema using Felicity.entityFor(), then call .validate((err, result) => {}) on a new instance of the constructor.

What result did you expect ?

According to API.md, the callback should receive a single parameter that is the same validation object as is returned by .validate() with no callback.

What result did you observe ?

The callback function receives 2 parameters, following the standard Node.js callback signature (err, result) => {}. The API.md documentation should be updated to reflect this behavior.

Publish v1.1.0

Summary of changes to be included in v1.1.0

entityFor option: strictInput

Utilize extended version of Joi

  • extend Joi with joi-date-extensions to support Joi.date().format() syntax deprecated in Joi v10.
  • related #83
  • commit 7327d89

Problem with alternatives.try when one of the alternatives is an object.

Context

  • node version: 6.9.2
  • felicity version: 1.3.1
  • joi version: 10.4.1
  • environment (node, browser): node

What are you trying to achieve or the steps to reproduce ?

Generate an example for a schema with alternatives, where one of the alternatives is an object.

const Felicity = require('felicity');
const Joi = require('joi');

const schema = Joi.alternatives().try(
    Joi.string(),
    Joi.object({ en: Joi.string(), es: Joi.string() })
);

Felicity.example(schema);

The error only shows up when the object schema is chosen as the alternative for the example.

What result did you expect ?

I expected a valid example for the object schema to be generated.

What result did you observe ?

image

Allow configurations.

There are some assumptions Felicity makes, such as stamping default values in and stripping optional properties out.

Both Felicity.skeleton and Felicity.example should take an optional configuration object to toggle these defaults as needed.

Support Joi extensions

This is a forum to discuss support and implementation of Joi extensions.

In order to maintain a 1:1 api parity with Joi, we will eventually need some level of support for Joi extensions.

It's important to note in thinking about implementation that extensions do not modify the Joi module itself, but provide a new Joi instance to the consumer. Felicity will not be able to pick up extensions automagically through Joi because of this fact. So we will need some sort of dynamic behavior for example and entityFor around customized schema types/extensions.

Recover 100% test coverage.

Context

  • felicity version: 1.0.1

What are you trying to achieve or the steps to reproduce ?

Travis build is failing due to <100% test coverage. Just adding an issue for this to promote transparency.

entityFor should not strip known keys with invalid values

Context

  • node version: 4.4.5
  • felicity version: 1.0.1
  • environment (node, browser): node

What are you trying to achieve or the steps to reproduce ?

When valid-shaped input with invalid values is provided to a constructor function from Felicity.entityFor, the values should not be stripped out of the input. Only unknown/disallowed keys should be stripped out of the input.

What result did you expect ?

const schema = Joi.object().keys({
    id: Joi.string().guid().required()
});

const Document = Felicity.entityFor(schema);

const input = { id: '1234567890', notes: [] };

const document = new Document(input); // { id: '1234567890' }

What result did you observe ?

const schema = Joi.object().keys({
    id: Joi.string().guid().required()
});

const Document = Felicity.entityFor(schema);

const input = { id: '1234567890', notes: [] };

const document = new Document(input); // { id: null }

Constructor

Felicity should provide a simple API for creating custom constructor functions from a schema.

Both returned Constructor and instances of Constructor should have the validate and example methods

const schema = Joi.object().keys({});
const Conversation = Felicity.builder(schema);

const conversation = new Conversation();
const mockConversation = conversation.example(); // or Conversation.example()
const validation = conversation.validate(); // or Conversation.validate(input)

Refactor /lib/helpers to leverage ES6 class syntax

There is a ton of duplicate logic and checking in the example data generation code base at /lib/helpers. This also creates complex edge cases (like #111 ).

The example data generation should leverage classes so that base Joi rules like defaults, valids, examples, etc can be abstracted into the base Example class. Each "type" can then handle type-specific rules more cleanly, and "meta" types like alternatives and object keys do not have to re-create raw schema and parse the rules/defaults/flags all over again.

Refactor all functions to use lambda (fat arrow) syntax

Context

Refactor all anonymous function declarations to use () => {} syntax. Should help with readability of the overall code base. But let's not refactor any function declaration with name associations such as function namedFunction(). But if possible, replaced those with let namedFunction = () => {}

Felicity example for number with max constraint hangs

Context

  • node version: 4.6.0
  • felicity version: 1.1.0
  • environment (node, browser): node
  • any relevant modules used with (hapi, hoek, etc.):
  • any other relevant information:

What are you trying to achieve or the steps to reproduce ?

The following test fails:

  describe('generating example for number with max', () => {

    it('should not hang', done => {

      const FelicityConstructor = Felicity.entityFor(Joi.number().max(1));
      const felicityInstance = new FelicityConstructor();
      const example = felicityInstance.example();

      expect(example).to.be.a.number();
      done();
    });

  })

What result did you expect ?

A successful test result

What result did you observe ?

The code hanging. Seems to be this while-loop that doesn't terminate.

Discussion of API.md

Please leave any comments, questions, concerns, advice, etc regarding the API.md documentation.

Feel free to make a PR to rewrite anything you want, but please tag the commit/PR with this issue so that I can see what was changed in one central spot. I like to learn and improve. :)

Add support for .example with input

What are you trying to achieve or the steps to reproduce ?

Allow .example methods to accept an input parameter. Valid input will be used instead of randomly-generated data.

const schema = Joi.object().keys({
    people: Joi.object().pattern(/^[0-9a-fA-F]{8}$/, Joi.object().keys({
        id  : Joi.string().guid().required(),
        tags: Joi.array().items(Joi.string())
    })).min(2).required()
});

const Pairing = Felicity.entityFor(schema);

const commonPerson = {
    people: {
        adc7d80c: {
            id: 'adc7d80c-f78c-44f1-94c6-73e816f5aa84',
            tags: ['admin']
        }
    }
};

const semiRandom = Pairing.example(commonPerson);
/*
{
    people: {
        adc7d80c: {
            id: 'adc7d80c-f78c-44f1-94c6-73e816f5aa84',
            tags: ['admin']
        },
        0ac079ea: {
            id: '0ac079ea-e92e-4d41-b6b5-ed493008e807',
            tags: ['da34fad']
        }
    }
}
*/

Allow dynamic constructor names

What are you trying to achieve or the steps to reproduce ?

Constructor functions created by Felicity.entityFor currently have the constructor name Constructor. There should be an option available to entityFor to override this name.

What result did you expect ?

> const User = Felicity.entityFor(Joi.object(), { config: { constructorName: 'User' } })
> new User()
User {}

What result did you observe ?

> const User = Felicity.entityFor(Joi.object())
> new User()
Constructor {}

Joi Peer Dependency??

I somehow overlooked the fact that Joi v10 was added as a peerDep. Is that needed since Joi is a direct dependency?

Enable`strictExample` for entityFor instances.

The below should be accurate. Right now, passing strictExample to entityFor does not persist the config for future .example() calls on instances.


  • strictExample - default false. Default behavior is to not run examples through Joi validation before returning.

If set to true, example will be validated prior to returning.

Note: in most cases, there is no difference. The only known cases where this may result in no example coming back are with regex patterns containing lookarounds.

const schema = Joi.object().keys({
    name    : Joi.string().regex(/abcd(?=efg)/)
});

const instance = new (Felicity.entityFor(schema)); // instance === { name: null }
const mockInstance = instance.example(); // mockInstance === { name: 'abcd' }

const strictInstance = new (Felicity.entityFor(schema, { config: { strictExample: true } })); strictInstance === { name: null }
const mockStrict = strictInstance.example(); // ValidationError

Felicity Logo

Once again following Hapi.js patterns:

create /images directory in repo root; drop png(s).
README: ![felicity Logo](https://raw.github.com/xogroup/felicity/master/images/felicity.png)

Epic README

Re-write README to follow standards of Hapi.js outlined here.

Buffer.alloc dependencies breaking test

Failed tests:

  11) Felicity Example should return a buffer:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at Object.exampleGenerator [as example] (/Users/lchan/Projects/felicity/lib/exampleGenerator.js:16:138)
      at /Users/lchan/Projects/felicity/test/felicity_tests.js:92:34
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  84) Binary should return a buffer:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:514:40
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  85) Binary should return a string with specified encoding:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:534:44
      at Array.forEach (native)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:531:28
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  86) Binary should return a buffer of minimum size:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:546:40
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  87) Binary should return a buffer of maximum size:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:554:40
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  88) Binary should return a buffer of specified size:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:562:40
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  89) Binary should return a buffer of size between min and max:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:571:40
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)

  122) Object should return an object with specified keys:

      Buffer.alloc is not a function

      at Object.internals.string.internals.number.internals.binary.schema [as binary] (/Users/lchan/Projects/felicity/lib/helpers.js:323:110)
      at /Users/lchan/Projects/felicity/lib/helpers.js:499:147
      at Array.forEach (native)
      at Object.internals.string.internals.number.internals.binary.internals.date.internals.array.internals.object.Object.keys.forEach.schemaDescription.rules.forEach.schemaDescription.dependencies.forEach.peers.forEach [as object] (/Users/lchan/Projects/felicity/lib/helpers.js:483:126)
      at /Users/lchan/Projects/felicity/test/value_generator_tests.js:960:40
      at Immediate._onImmediate (/Users/lchan/Projects/felicity/node_modules/lab/lib/runner.js:647:36)
      at processImmediate [as _immediateCallback] (timers.js:383:17)


8 of 131 tests failed
Test duration: 389 ms
Assertions count: 1575 (verbosity: 12.02)
No global variable leaks detected
Coverage: 99.87% (1/754)
lib/helpers.js missing coverage on line(s): 329
Code coverage below threshold: 99.87 < 100
Linting results: No issues

npm ERR! Test failed.  See above for more details.

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.