UNPKG

@thumbmarkjs/thumbmarkjs

Version:

![GitHub package.json dynamic](https://img.shields.io/github/package-json/version/ilkkapeltola/thumbmarkjs) ![NPM Version](https://img.shields.io/npm/v/@thumbmarkjs/thumbmarkjs) ![NPM Downloads](https://img.shields.io/npm/dm/%40thumbmarkjs%2Fthumbmarkjs

34 lines (31 loc) 1.09 kB
import {componentInterface} from '../factory' import {filterFingerprintData} from './functions' const test_components: componentInterface = { 'one': '1', 'two': 2, 'three': {'a': true, 'b': false} } describe('component filtering tests', () => { test("excluding top level works", () => { expect(filterFingerprintData(test_components, ['one'], [])).toMatchObject({ 'two': 2, 'three': {'a': true, 'b': false} }) }); test("including top level works", () => { expect(filterFingerprintData(test_components, [], ['one', 'two'])).toMatchObject({ 'one': '1', 'two': 2 }) }); test("excluding low-level works", () => { expect(filterFingerprintData(test_components, ['two', 'three.a'], [])).toMatchObject({ 'one': '1', 'three': {'b': false} }) }); test("including low-level works", () => { expect(filterFingerprintData(test_components, [], ['one', 'three.b'])).toMatchObject({ 'one': '1', 'three': {'b': false} }) }); });