UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).

16 lines (14 loc) 512 B
import { forEach, isPlainObject, isArray, isObject } from 'substance' export default function checkValues (t, actual, expected) { if (!isObject(actual)) { t.fail('Provided object is invalid: actual=' + String(actual)) return } forEach(expected, (expectedVal, key) => { if (isPlainObject(expectedVal) || isArray(expectedVal)) { t.deepEqual(actual[key], expectedVal, key + ' should be correct') } else { t.equal(actual[key], expectedVal, key + ' should be correct') } }) }