File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
var Plotly = require ( '@lib/index' ) ;
2
2
3
3
describe ( '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
+ } ) ;
4
25
5
26
it ( 'should throw an error when no argument is given' , function ( ) {
6
27
expect ( function ( ) {
You can’t perform that action at this time.
0 commit comments