We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d46ae26 commit 02eca97Copy full SHA for 02eca97
test/jasmine/tests/register_test.js
@@ -1,6 +1,27 @@
1
var Plotly = require('@lib/index');
2
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
25
26
it('should throw an error when no argument is given', function() {
27
expect(function() {
0 commit comments