test(project): make sinon an allowed global

This commit is contained in:
Nico Rehwaldt 2019-12-01 13:21:06 +01:00 committed by Philipp Fromme
parent a66e9a5c8d
commit 1b576cda17
15 changed files with 22 additions and 50 deletions

5
test/spec/.eslintrc Normal file
View File

@ -0,0 +1,5 @@
{
"globals": {
"sinon": true
}
}

View File

@ -1574,7 +1574,6 @@ describe('Viewer', function() {
// assume
expect(viewer._container.parentNode).not.to.exist;
/* global sinon */
var resizedSpy = sinon.spy();
viewer.on('canvas.resized', resizedSpy);

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject

View File

@ -27,8 +27,6 @@ import {
is
} from 'lib/util/ModelUtil';
/* global sinon */
describe('features/copy-paste', function() {

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapViewer,
inject

View File

@ -6,8 +6,6 @@ import {
import modelingModule from 'lib/features/modeling';
import coreModule from 'lib/core';
/* global sinon */
var testModules = [ modelingModule, coreModule ];

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject
@ -15,10 +13,9 @@ var testModules = [
coreModule
];
var spy = sinon.spy;
var ATTACH = { attach: true };
describe('modeling/behavior - AdaptiveLabelPositioningBehavior', function() {
function expectLabelOrientation(element, expectedOrientation) {
@ -431,7 +428,7 @@ describe('modeling/behavior - AdaptiveLabelPositioningBehavior', function() {
var exclusiveGateway = elementRegistry.get('ExclusiveGateway_1'),
endEvent = elementRegistry.get('EndEvent_1');
var moveShapeSpy = spy(modeling, 'moveShape');
var moveShapeSpy = sinon.spy(modeling, 'moveShape');
// when
copyPaste.copy([ exclusiveGateway, endEvent ]);

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject

View File

@ -13,9 +13,6 @@ import bendpointsModule from 'diagram-js/lib/features/bendpoints';
import { createCanvasEvent as canvasEvent } from '../../../../util/MockEvents';
/* global sinon */
var spy = sinon.spy;
var testModules = [
coreModule,
createModule,
@ -238,7 +235,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_lanes = elementRegistry.get('Participant_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.context.startTarget).to.eql(participant_lanes);
});
@ -266,7 +263,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_lanes = elementRegistry.get('Participant_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.hover).to.eql(participant_lanes);
});
@ -293,7 +290,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_lanes = elementRegistry.get('Participant_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.hover).to.eql(participant_lanes);
});
@ -328,7 +325,7 @@ describe('features/modeling/behavior - fix hover', function() {
var messageFlow = elementRegistry.get('MessageFlow_2');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.context.hover).to.equal(participant_lanes);
});
@ -356,7 +353,7 @@ describe('features/modeling/behavior - fix hover', function() {
var messageFlow = elementRegistry.get('MessageFlow_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.context.target).to.eql(participant_lanes);
});
@ -387,7 +384,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_no_lanes = elementRegistry.get('Participant_No_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.context.source).to.eql(participant_lanes);
});
@ -416,7 +413,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_no_lanes = elementRegistry.get('Participant_No_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
var context = event.context,
target = context.target;
@ -450,7 +447,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_no_lanes = elementRegistry.get('Participant_No_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.hover).to.eql(participant_lanes);
});
@ -478,7 +475,7 @@ describe('features/modeling/behavior - fix hover', function() {
var participant_no_lanes = elementRegistry.get('Participant_No_Lanes');
var lane_1 = elementRegistry.get('Lane_1');
var connectSpy = spy(function(event) {
var connectSpy = sinon.spy(function(event) {
expect(event.hover).to.eql(participant_lanes);
});
@ -531,7 +528,7 @@ describe('features/modeling/behavior - fix hover', function() {
var rootElement = canvas.getRootElement(),
rootElementGfx = canvas.getGraphics(rootElement);
var moveEndSpy = spy(function(event) {
var moveEndSpy = sinon.spy(function(event) {
expect(event.context.shape).to.equal(participant);
});

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
inject
@ -22,8 +20,6 @@ import modelingModule from 'lib/features/modeling';
import coreModule from 'lib/core';
import gridSnappingModule from 'lib/features/grid-snapping';
var spy = sinon.spy;
describe('behavior - LabelBehavior', function() {
@ -209,7 +205,7 @@ describe('behavior - LabelBehavior', function() {
// given
var parentShape = elementRegistry.get('Process_1');
var createLabelSpy = spy(modeling, 'createLabel');
var createLabelSpy = sinon.spy(modeling, 'createLabel');
var exclusiveGatewayBo = bpmnFactory.create('bpmn:ExclusiveGateway', {
name: 'Foo'

View File

@ -1,5 +1,3 @@
/* global sinon */
import {
bootstrapModeler,
getBpmnJS,
@ -26,8 +24,6 @@ import { is } from 'lib/util/ModelUtil';
import { isExpanded } from 'lib/util/DiUtil';
var spy = sinon.spy;
describe('features/popup-menu - replace menu provider', function() {
@ -1685,7 +1681,7 @@ describe('features/popup-menu - replace menu provider', function() {
// given
var subProcess = elementRegistry.get('SubProcess_1');
var resizeShapeSpy = spy(modeling, 'resizeShape');
var resizeShapeSpy = sinon.spy(modeling, 'resizeShape');
// when
openPopup(subProcess);
@ -1702,7 +1698,7 @@ describe('features/popup-menu - replace menu provider', function() {
// given
var subProcess = elementRegistry.get('SubProcess_1');
var layoutConnectionSpy = spy(modeling, 'layoutConnection');
var layoutConnectionSpy = sinon.spy(modeling, 'layoutConnection');
// when
openPopup(subProcess);
@ -1722,7 +1718,7 @@ describe('features/popup-menu - replace menu provider', function() {
// given
var adhocSubProcess = elementRegistry.get('AdhocSubProcess_1');
var resizeShapeSpy = spy(modeling, 'resizeShape');
var resizeShapeSpy = sinon.spy(modeling, 'resizeShape');
// when
openPopup(adhocSubProcess);
@ -1739,7 +1735,7 @@ describe('features/popup-menu - replace menu provider', function() {
// given
var adhocSubProcess = elementRegistry.get('AdhocSubProcess_1');
var layoutConnectionSpy = spy(modeling, 'layoutConnection');
var layoutConnectionSpy = sinon.spy(modeling, 'layoutConnection');
// when
openPopup(adhocSubProcess);

View File

@ -1,5 +1,3 @@
/* global sinon */
import BpmnTreeWalker from 'lib/import/BpmnTreeWalker';
import BpmnModdle from 'bpmn-moddle';