Skip to content

Commit ab01120

Browse files
committed
chore(test): import explicit files
This prepares us to migrate diagram-js to an ES module. Related to #863
1 parent 0370a9a commit ab01120

File tree

167 files changed

+798
-775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+798
-775
lines changed

test/TestHelper.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export * from './helper';
1+
export * from './helper/index.js';
22

33
import {
44
insertCSS
5-
} from './helper';
5+
} from './helper/index.js';
66

77
import diagramCSS from '../assets/diagram-js.css';
88

@@ -14,8 +14,8 @@ insertCSS('diagram-js-testing.css',
1414
);
1515

1616

17-
import BoundsMatchers from './matchers/BoundsMatchers';
18-
import ConnectionMatchers from './matchers/ConnectionMatchers';
17+
import BoundsMatchers from './matchers/BoundsMatchers.js';
18+
import ConnectionMatchers from './matchers/ConnectionMatchers.js';
1919

2020
/* global chai */
2121

test/matchers/BoundsMatchers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { pick } from 'min-dash';
22

33
/**
4-
* @typedef {import('../../lib/util/Types').Dimensions} Dimensions
5-
* @typedef {import('../../lib/util/Types').Point} Point
6-
* @typedef {import('../../lib/util/Types').Rect} Rect
7-
* @typedef {import('../../lib/util/Types').RectTRBL} RectTRBL
4+
* @typedef {import('../../lib/util/Types.js').Dimensions} Dimensions
5+
* @typedef {import('../../lib/util/Types.js').Point} Point
6+
* @typedef {import('../../lib/util/Types.js').Rect} Rect
7+
* @typedef {import('../../lib/util/Types.js').RectTRBL} RectTRBL
88
*/
99

1010
var BOUNDS_ATTRS = [ 'x', 'y', 'width', 'height' ],

test/matchers/BoundsMatchersSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
create
3-
} from 'lib/model';
3+
} from 'lib/model/index.js';
44

55

66
describe('matchers/BoundsMatchers', function() {

test/matchers/ConnectionMatchers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { pick } from 'min-dash';
22

33
/**
4-
* @typedef {import('../../lib/util/Types').Point} Point
4+
* @typedef {import('../../lib/util/Types.js').Point} Point
55
*/
66

77
var POSITION_ATTRS = [ 'x', 'y' ];

test/matchers/ConnectionMatchersSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
22
create
3-
} from 'lib/model';
3+
} from 'lib/model/index.js';
44

55

66
describe('matchers/ConnectionMatchers', function() {

test/spec/command/CommandInterceptorSpec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import inherits from 'inherits-browser';
2+
13
import {
24
bootstrapDiagram,
35
inject
4-
} from 'test/TestHelper';
5-
6-
import inherits from 'inherits-browser';
6+
} from 'test/TestHelper.js';
77

8-
import cmdModule from 'lib/command';
8+
import cmdModule from 'lib/command/index.js';
99

10-
import CommandInterceptor from 'lib/command/CommandInterceptor';
10+
import CommandInterceptor from 'lib/command/CommandInterceptor.js';
1111

1212

1313
// example commands

test/spec/command/CommandStackSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
bootstrapDiagram,
33
inject
4-
} from 'test/TestHelper';
4+
} from 'test/TestHelper.js';
55

66

7-
import cmdModule from 'lib/command';
7+
import cmdModule from 'lib/command/index.js';
88

99
// example commands
1010

test/spec/connection-preview/ConnectionPreviewSpec.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1+
import {
2+
query as domQuery
3+
} from 'min-dom';
4+
5+
import {
6+
isDefined
7+
} from 'min-dash';
8+
19
import {
210
bootstrapDiagram,
311
inject
4-
} from 'test/TestHelper';
12+
} from 'test/TestHelper.js';
513

614
import TestContainer from 'mocha-test-container-support';
715

8-
import modelingModule from 'lib/features/modeling';
9-
import connectionPreviewModule from 'lib/features/connection-preview';
10-
11-
import BaseLayouter from 'lib/layout/BaseLayouter';
12-
import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking';
16+
import modelingModule from 'lib/features/modeling/index.js';
17+
import connectionPreviewModule from 'lib/features/connection-preview/index.js';
1318

14-
import {
15-
query as domQuery
16-
} from 'min-dom';
17-
import { isDefined } from 'min-dash';
19+
import BaseLayouter from 'lib/layout/BaseLayouter.js';
20+
import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js';
1821

19-
import { getMid } from '../../../lib/layout/LayoutUtil';
22+
import { getMid } from '../../../lib/layout/LayoutUtil.js';
2023

2124
var testModules = [
2225
modelingModule,

test/spec/core/CanvasSpec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
import {
2-
bootstrapDiagram,
3-
getDiagramJS,
4-
inject
5-
} from 'test/TestHelper';
6-
7-
import TestContainer from 'mocha-test-container-support';
8-
91
import { merge } from 'min-dash';
102

113
import {
@@ -17,7 +9,15 @@ import {
179
classes as svgClasses
1810
} from 'tiny-svg';
1911

20-
import { getChildren as getChildrenGfx } from 'lib/util/GraphicsUtil';
12+
import TestContainer from 'mocha-test-container-support';
13+
14+
import {
15+
bootstrapDiagram,
16+
getDiagramJS,
17+
inject
18+
} from 'test/TestHelper.js';
19+
20+
import { getChildren as getChildrenGfx } from 'lib/util/GraphicsUtil.js';
2121

2222

2323
describe('Canvas', function() {

test/spec/core/ElementRegistrySpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
bootstrapDiagram,
33
inject
4-
} from 'test/TestHelper';
4+
} from 'test/TestHelper.js';
55

66

77
describe('ElementRegistry', function() {

0 commit comments

Comments
 (0)