Add data structures for chart plugin system (#6028)

* add unit tests

* add test structure

* add unit tests for Registry

* add LoaderRegistry unit test

* add unit test for makeSingleton

* add type check

* add plugin data structures

* simplify API

* add preset tests

* update test message

* fix lint

* update makeSingleton

* update Plugin, Preset and unit test

* revise Registry code

* update unit test, add remove function

* update test

* update unit test

* update plugin unit test

* add .keys(), .entries() and .entriesAsPromise()

* update test description
This commit is contained in:
Krist Wongsuphasawat
2018-10-09 11:47:16 -07:00
committed by Chris Williams
parent 395359f5ad
commit cd2c46a5ed
16 changed files with 602 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import { it, describe } from 'mocha';
import { expect } from 'chai';
import isRequired from '../../../src/utils/isRequired';
describe('isRequired(field)', () => {
it('should throw error with the given field in the message', () => {
expect(() => isRequired('myField')).to.throw(Error, 'myField is required.');
});
});