File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 11var Plotly = require ( '@lib/index' ) ;
22
33describe ( 'the register function' , function ( ) {
4+ 'use strict' ;
5+
6+ var Plots = Plotly . Plots ;
7+
8+ beforeEach ( function ( ) {
9+ this . modulesKeys = Object . keys ( Plots . modules ) ;
10+ this . allTypesKeys = Object . keys ( Plots . allTypes ) ;
11+ this . allCategoriesKeys = Object . keys ( Plots . allCategories ) ;
12+ } ) ;
13+
14+ afterEach ( function ( ) {
15+ function revertObj ( obj , initialKeys ) {
16+ Object . keys ( obj ) . forEach ( function ( k ) {
17+ if ( initialKeys . indexOf ( k ) === - 1 ) delete obj [ k ] ;
18+ } ) ;
19+ }
20+
21+ revertObj ( Plots . modules , this . modulesKeys ) ;
22+ revertObj ( Plots . allTypes , this . allTypesKeys ) ;
23+ revertObj ( Plots . allCategories , this . allCategoriesKeys ) ;
24+ } ) ;
425
526 it ( 'should throw an error when no argument is given' , function ( ) {
627 expect ( function ( ) {
You can’t perform that action at this time.
0 commit comments