Skip to content

Commit ef345ef

Browse files
committed
refactor tests
1 parent b532cb0 commit ef345ef

File tree

9 files changed

+43
-40
lines changed

9 files changed

+43
-40
lines changed

test/jasmine/performance_tests/bar_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyBar = require('../../../lib/bar');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyBar);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
n: 1000
1217
}, {
@@ -27,11 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test bar | size:' + spec.n, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyBar);
31-
32-
const samples = Array.from({ length: 9 }, (_, i) => i);
33-
const nTimes = samples.length - 1;
34-
3535
var y = Float64Array.from({ length: spec.n }, (_, i) => i * Math.cos(Math.sqrt(i)));
3636

3737
var mock = {

test/jasmine/performance_tests/box_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyBox = require('../../../lib/box');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyBox);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
n: 1000
1217
}, {
@@ -27,11 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test box | size:' + spec.n, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyBox);
31-
32-
const samples = Array.from({ length: 9 }, (_, i) => i);
33-
const nTimes = samples.length - 1;
34-
3535
var y = Float64Array.from({ length: spec.n }, (_, i) => i * Math.cos(Math.sqrt(i)));
3636

3737
var mock = {

test/jasmine/performance_tests/contour_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyContour = require('../../../lib/contour');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyContour);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
nx: 50, ny: 20
1217
}, {
@@ -27,11 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test contour | size:' + spec.nx + 'X' + spec.ny, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyContour);
31-
32-
const samples = Array.from({ length: 9 }, (_, i) => i);
33-
const nTimes = samples.length - 1;
34-
3535
var A = spec.nx;
3636
var B = spec.ny;
3737
spec.n = A * B;

test/jasmine/performance_tests/heatmap_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyHeatmap = require('../../../lib/heatmap');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyHeatmap);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
nx: 50, ny: 20
1217
}, {
@@ -27,11 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test heatmap | size:' + spec.nx + 'X' + spec.ny, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyHeatmap);
31-
32-
const samples = Array.from({ length: 9 }, (_, i) => i);
33-
const nTimes = samples.length - 1;
34-
3535
var A = spec.nx;
3636
var B = spec.ny;
3737
spec.n = A * B;

test/jasmine/performance_tests/histogram_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyHistogram = require('../../../lib/histogram');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyHistogram);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
n: 1000
1217
}, {
@@ -27,11 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test histogram | size:' + spec.n, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyHistogram);
31-
32-
const samples = Array.from({ length: 9 }, (_, i) => i);
33-
const nTimes = samples.length - 1;
34-
3535
var x = Float64Array.from({ length: spec.n }, (_, i) => i * Math.cos(Math.sqrt(i)));
3636

3737
var mock = {

test/jasmine/performance_tests/image_test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyImage = require('../../../lib/image');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyImage);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
nx: 50, ny: 20
1217
}, {
@@ -27,8 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test image | size:' + spec.nx + 'X' + spec.ny, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyImage);
31-
3235
const samples = Array.from({ length: 9 }, (_, i) => i);
3336
const nTimes = samples.length - 1;
3437

test/jasmine/performance_tests/scatter_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
66

77
var gd = createGraphDiv();
88

9+
const samples = Array.from({ length: 9 }, (_, i) => i);
10+
const nTimes = samples.length - 1;
11+
912
var tests = [{
1013
n: 1000
1114
}, {
@@ -26,9 +29,6 @@ tests.forEach(function(spec, index) {
2629
describe('Performance test scatter | size:' + spec.n, function() {
2730
'use strict';
2831

29-
const samples = Array.from({ length: 9 }, (_, i) => i);
30-
const nTimes = samples.length - 1;
31-
3232
var y = Float64Array.from({ length: spec.n }, (_, i) => i * Math.cos(Math.sqrt(i)));
3333

3434
var mock = {

test/jasmine/performance_tests/scattergl_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ var Plotly = require('../../../lib/core');
44
var PlotlyScattergl = require('../../../lib/scattergl');
55
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
66

7+
Plotly.register(PlotlyScattergl);
8+
79
var gd = createGraphDiv();
810

11+
const samples = Array.from({ length: 9 }, (_, i) => i);
12+
const nTimes = samples.length - 1;
13+
914
var tests = [{
1015
n: 1000
1116
}, {
@@ -34,11 +39,6 @@ tests.forEach(function(spec, index) {
3439
describe('Performance test scattergl | size:' + spec.n, function() {
3540
'use strict';
3641

37-
Plotly.register(PlotlyScattergl);
38-
39-
const samples = Array.from({ length: 9 }, (_, i) => i);
40-
const nTimes = samples.length - 1;
41-
4242
var y = Float64Array.from({ length: spec.n }, (_, i) => i * Math.cos(Math.sqrt(i)));
4343

4444
var mock = {

test/jasmine/performance_tests/violin_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ var Plotly = require('../../../lib/core');
55
var PlotlyViolin = require('../../../lib/violin');
66
var writeRawDataAsCSV = require('./assets/post_process').writeRawDataAsCSV;
77

8+
Plotly.register(PlotlyViolin);
9+
810
var gd = createGraphDiv();
911

12+
const samples = Array.from({ length: 9 }, (_, i) => i);
13+
const nTimes = samples.length - 1;
14+
1015
var tests = [{
1116
n: 1000
1217
}, {
@@ -27,11 +32,6 @@ tests.forEach(function(spec, index) {
2732
describe('Performance test violin | size:' + spec.n, function() {
2833
'use strict';
2934

30-
Plotly.register(PlotlyViolin);
31-
32-
const samples = Array.from({ length: 9 }, (_, i) => i);
33-
const nTimes = samples.length - 1;
34-
3535
var y = Float64Array.from({ length: spec.n }, (_, i) => i * Math.cos(Math.sqrt(i)));
3636

3737
var mock = {

0 commit comments

Comments
 (0)