dyo-tools 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.c8rc.json +4 -4
- package/.eslintignore +1 -1
- package/.eslintrc.json +47 -47
- package/Makefile +34 -34
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +24 -20
- package/dist/constants.js.map +1 -1
- package/dist/core/DTAction.d.ts +6 -4
- package/dist/core/DTAction.d.ts.map +1 -0
- package/dist/core/DTAction.js +3 -6
- package/dist/core/DTAction.js.map +1 -1
- package/dist/core/DTBunch.d.ts +8 -5
- package/dist/core/DTBunch.d.ts.map +1 -0
- package/dist/core/DTBunch.js +53 -19
- package/dist/core/DTBunch.js.map +1 -1
- package/dist/core/DTComponent.d.ts +13 -10
- package/dist/core/DTComponent.d.ts.map +1 -0
- package/dist/core/DTComponent.js +23 -10
- package/dist/core/DTComponent.js.map +1 -1
- package/dist/core/DTComponentPhysical.d.ts +11 -8
- package/dist/core/DTComponentPhysical.d.ts.map +1 -0
- package/dist/core/DTComponentPhysical.js +21 -6
- package/dist/core/DTComponentPhysical.js.map +1 -1
- package/dist/core/DTComponentWithMeta.d.ts +6 -3
- package/dist/core/DTComponentWithMeta.d.ts.map +1 -0
- package/dist/core/DTComponentWithMeta.js +21 -7
- package/dist/core/DTComponentWithMeta.js.map +1 -1
- package/dist/core/DTElement.d.ts +10 -8
- package/dist/core/DTElement.d.ts.map +1 -0
- package/dist/core/DTElement.js +8 -9
- package/dist/core/DTElement.js.map +1 -1
- package/dist/core/DTError.d.ts +8 -7
- package/dist/core/DTError.d.ts.map +1 -0
- package/dist/core/DTError.js +1 -5
- package/dist/core/DTError.js.map +1 -1
- package/dist/core/DTManager.d.ts +17 -14
- package/dist/core/DTManager.d.ts.map +1 -0
- package/dist/core/DTManager.js +84 -26
- package/dist/core/DTManager.js.map +1 -1
- package/dist/core/DTMaster.d.ts +19 -16
- package/dist/core/DTMaster.d.ts.map +1 -0
- package/dist/core/DTMaster.js +48 -31
- package/dist/core/DTMaster.js.map +1 -1
- package/dist/core/DTModule.d.ts +8 -5
- package/dist/core/DTModule.d.ts.map +1 -0
- package/dist/core/DTModule.js +6 -6
- package/dist/core/DTModule.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -28
- package/dist/index.js.map +1 -1
- package/dist/libs/DYOFinder.d.ts +1 -0
- package/dist/libs/DYOFinder.d.ts.map +1 -0
- package/dist/libs/DYOFinder.js +10 -14
- package/dist/libs/DYOFinder.js.map +1 -1
- package/dist/libs/dix/DIXModule.module.d.ts +8 -0
- package/dist/libs/dix/DIXModule.module.d.ts.map +1 -0
- package/dist/libs/dix/DIXModule.module.js +73 -0
- package/dist/libs/player/DTPlayer.element.d.ts +3 -2
- package/dist/libs/player/DTPlayer.element.d.ts.map +1 -0
- package/dist/libs/player/DTPlayer.element.js +2 -6
- package/dist/libs/player/DTPlayer.element.js.map +1 -1
- package/dist/libs/player/DTPlayer.manager.d.ts +8 -7
- package/dist/libs/player/DTPlayer.manager.d.ts.map +1 -0
- package/dist/libs/player/DTPlayer.manager.js +13 -20
- package/dist/libs/player/DTPlayer.manager.js.map +1 -1
- package/dist/tsconfig.dev.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/core.d.ts +40 -12
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +2 -6
- package/dist/types/core.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -19
- package/dist/types/index.js.map +1 -1
- package/dist/types/player.d.ts +1 -1
- package/dist/types/player.d.ts.map +1 -0
- package/dist/types/player.js +1 -3
- package/integration/data/components/DTHero.ts +42 -0
- package/integration/data/components/DTHeroManager.ts +11 -0
- package/integration/data/components/DTHeroPlayZone.ts +6 -0
- package/integration/data/components/DTHeroPlayerHand.ts +11 -0
- package/integration/data/components/index.ts +5 -0
- package/integration/data/in/heroIn.helper.ts +8 -0
- package/integration/data/in/playerIn.helper.ts +13 -0
- package/integration/data/out/heroOut.helper.ts +48 -0
- package/integration/endings/synchronisation.ending.ts +25 -0
- package/integration/scenes/drawCard.scene.ts +31 -0
- package/integration/scenes/empty.scene.ts +6 -0
- package/integration/scenes/playCard.scene.ts +23 -0
- package/integration/scenes/playerLeave.scene.ts +33 -0
- package/integration/stages/baseDix.stage.ts +137 -0
- package/integration/stages/syncDix.stage.ts +36 -0
- package/integration/tests/scenario1.spec.ts +55 -0
- package/integration/types/index.ts +24 -0
- package/jest-integration.config.ts +25 -0
- package/jest.config.ts +26 -0
- package/package.json +31 -19
- package/src/constants.ts +2 -0
- package/src/core/DTAction.ts +7 -5
- package/src/core/DTBunch.ts +78 -14
- package/src/core/DTComponent.ts +48 -15
- package/src/core/DTComponentPhysical.ts +45 -11
- package/src/core/DTComponentWithMeta.ts +37 -4
- package/src/core/DTElement.ts +19 -10
- package/src/core/DTError.ts +7 -7
- package/src/core/DTManager.ts +120 -30
- package/src/core/DTMaster.ts +76 -28
- package/src/core/DTModule.ts +12 -6
- package/src/index.ts +17 -17
- package/src/libs/DYOFinder.ts +175 -175
- package/src/libs/dix/DIXModule.module.ts +98 -0
- package/src/libs/player/DTPlayer.element.ts +2 -2
- package/src/libs/player/DTPlayer.manager.ts +20 -34
- package/src/types/core.ts +39 -4
- package/src/types/index.ts +2 -2
- package/src/types/player.ts +0 -1
- package/test/core/DTAction.double.ts +12 -28
- package/test/core/DTAction.spec.ts +8 -16
- package/test/core/DTBunch.double.ts +49 -135
- package/test/core/DTBunch.spec.ts +157 -245
- package/test/core/DTComponent.double.ts +17 -2
- package/test/core/DTComponent.spec.ts +6 -4
- package/test/core/DTComponentPhysical.double.ts +29 -43
- package/test/core/DTComponentPhysical.spec.ts +22 -19
- package/test/core/DTComponentWithMeta.double.ts +38 -31
- package/test/core/DTComponentWithMeta.spec.ts +23 -18
- package/test/core/DTElement.double.ts +32 -53
- package/test/core/DTElement.spec.ts +15 -38
- package/test/core/DTError.double.ts +18 -53
- package/test/core/DTError.spec.ts +21 -32
- package/test/core/DTManager.double.ts +74 -141
- package/test/core/DTManager.spec.ts +289 -380
- package/test/core/DTMaster.double.ts +56 -80
- package/test/core/DTMaster.spec.ts +185 -232
- package/test/core/DTModule.double.ts +12 -25
- package/test/core/DTModule.spec.ts +14 -28
- package/test/core/copy.spec.ts +9 -30
- package/tsconfig.dev.json +5 -8
- package/tsconfig.json +5 -8
- package/cucumber-report.html +0 -48
- package/docs/assets/navigation.js +0 -1
- package/docs/classes/core_DTAction.DYOToolsAction.html +0 -89
- package/docs/classes/core_DTBunch.DYOToolsBunch.html +0 -254
- package/docs/classes/core_DTComponent.DYOToolsComponent.html +0 -76
- package/docs/classes/core_DTComponentPhysical.DYOToolsComponentPhysical.html +0 -110
- package/docs/classes/core_DTComponentWithMeta.DYOToolsComponentWithMeta.html +0 -96
- package/docs/classes/core_DTElement.DYOToolsElement.html +0 -135
- package/docs/classes/core_DTError.DYOToolsError.html +0 -37
- package/docs/classes/core_DTManager.DYOToolsManager.html +0 -237
- package/docs/classes/core_DTMaster.DYOToolsMaster.html +0 -150
- package/docs/classes/core_DTModule.DYOToolsModule.html +0 -92
- package/docs/classes/libs_DYOFinder.DYOFinder.html +0 -34
- package/docs/classes/libs_player_DTPlayer_element.DYOToolsPlayer.html +0 -134
- package/docs/classes/libs_player_DTPlayer_manager.DYOToolsPlayerManager.html +0 -243
- package/docs/enums/types_core.FilterOperatorType.html +0 -10
- package/docs/hierarchy.html +0 -1
- package/docs/interfaces/types_core.DTBunchFilters.html +0 -6
- package/docs/interfaces/types_core.DTBunchOptions.html +0 -19
- package/docs/interfaces/types_core.DTBunchToObject.html +0 -7
- package/docs/interfaces/types_core.DTComponentOptions.html +0 -5
- package/docs/interfaces/types_core.DTComponentToObject.html +0 -4
- package/docs/interfaces/types_core.DTElementToObject.html +0 -7
- package/docs/interfaces/types_core.DTManagerFilters.html +0 -6
- package/docs/interfaces/types_core.DTManagerOptions.html +0 -8
- package/docs/interfaces/types_core.DTManagerToObject.html +0 -5
- package/docs/interfaces/types_core.DTMasterToObject.html +0 -8
- package/docs/interfaces/types_core.DTModuleToObject.html +0 -6
- package/docs/interfaces/types_core.DYOFinderConfigurationPropDefault.html +0 -4
- package/docs/interfaces/types_core.DYOFinderConfigurationPropObjectSearch.html +0 -4
- package/docs/interfaces/types_core.DYOFinderFilterOperatorAdvanced.html +0 -5
- package/docs/interfaces/types_core.DYOFinderFilterOperatorBase.html +0 -5
- package/docs/interfaces/types_player.DTPlayerManagerSimpleConfiguration.html +0 -3
- package/docs/modules/constants.html +0 -6
- package/docs/modules/core_DTAction.html +0 -2
- package/docs/modules/core_DTBunch.html +0 -2
- package/docs/modules/core_DTComponent.html +0 -2
- package/docs/modules/core_DTComponentPhysical.html +0 -2
- package/docs/modules/core_DTComponentWithMeta.html +0 -2
- package/docs/modules/core_DTElement.html +0 -2
- package/docs/modules/core_DTError.html +0 -2
- package/docs/modules/core_DTManager.html +0 -2
- package/docs/modules/core_DTMaster.html +0 -2
- package/docs/modules/core_DTModule.html +0 -2
- package/docs/modules/libs_DYOFinder.html +0 -2
- package/docs/modules/libs_player_DTPlayer_element.html +0 -2
- package/docs/modules/libs_player_DTPlayer_manager.html +0 -2
- package/docs/modules/types.html +0 -29
- package/docs/modules/types_core.html +0 -28
- package/docs/modules/types_player.html +0 -2
- package/docs/types/types_core.DTAcceptedMetaData.html +0 -2
- package/docs/types/types_core.DTManagerItemType.html +0 -1
- package/docs/types/types_core.DTManagerItemsType.html +0 -2
- package/docs/types/types_core.DYOFinderComponentType.html +0 -1
- package/docs/types/types_core.DYOFinderConfiguration.html +0 -2
- package/docs/types/types_core.DYOFinderConfigurationProp.html +0 -1
- package/docs/types/types_core.DYOFinderFilterOperator.html +0 -1
- package/docs/types/types_core.DYOFinderFilterOperatorArgument.html +0 -1
- package/docs/types/types_core.DYOFinderFilters.html +0 -1
- package/docs/types/types_core.StandardPrimitiveType.html +0 -2
- package/docs/types/types_core.StandardPrimitiveTypeWithArray.html +0 -1
- package/docs/variables/constants.bunchDefaultOptions.html +0 -2
- package/docs/variables/constants.componentBunchDefaultFinderConfiguration.html +0 -1
- package/docs/variables/constants.componentManagerDefaultFinderConfiguration.html +0 -1
- package/docs/variables/constants.componentPhysicalDefaultFinderConfiguration.html +0 -1
- package/docs/variables/constants.managerDefaultOptions.html +0 -2
- package/jest.config.js +0 -6
|
@@ -25,33 +25,20 @@ export const module1ToObject: DTModuleToObject = {
|
|
|
25
25
|
* Providing methods to property access and other facilities, in order to avoid using class methods
|
|
26
26
|
* **** */
|
|
27
27
|
export class DTModuleTest extends DTModule {
|
|
28
|
-
th_get_id(): string {
|
|
29
|
-
return this._id;
|
|
30
|
-
}
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
constructor(
|
|
30
|
+
id: string = IDTest,
|
|
31
|
+
key: string = KeyTest,
|
|
32
|
+
enabled: boolean = true,
|
|
33
|
+
) {
|
|
34
|
+
super(key);
|
|
33
35
|
this._id = id;
|
|
36
|
+
this._enabled = enabled
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
return this._key;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
th_set_key(key: string): void {
|
|
41
|
-
this._key = key;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
th_get_componentType(): string {
|
|
45
|
-
return this._componentType;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
th_get_enabled(): boolean {
|
|
39
|
+
_getEnabled(): boolean {
|
|
49
40
|
return this._enabled;
|
|
50
41
|
}
|
|
51
|
-
|
|
52
|
-
th_set_enabled(enabled: boolean): void {
|
|
53
|
-
this._enabled = enabled;
|
|
54
|
-
}
|
|
55
42
|
}
|
|
56
43
|
|
|
57
44
|
|
|
@@ -66,12 +53,12 @@ export class DTModuleStub extends DTModuleTest {
|
|
|
66
53
|
this._errors = [];
|
|
67
54
|
}
|
|
68
55
|
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
_setId(id: string) {
|
|
57
|
+
this._id = id;
|
|
71
58
|
}
|
|
72
59
|
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
_setKey(key: string) {
|
|
61
|
+
this._key = key;
|
|
75
62
|
}
|
|
76
63
|
}
|
|
77
64
|
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import {DTComponent, DTModule} from "../../src";
|
|
2
|
-
import {mockOverriddenMethods} from "./DTComponent.double";
|
|
3
2
|
import {afterEach, beforeEach, describe, expect, jest, test} from "@jest/globals";
|
|
4
3
|
import {DTModuleTest, IDTest, KeyTest} from "./DTModule.double";
|
|
5
|
-
import MockedFunction = jest.MockedFunction;
|
|
6
|
-
|
|
7
|
-
/** ****************** MOCK DEPENDENCIES
|
|
8
|
-
* Dependencies used by the component are mocked with Jest
|
|
9
|
-
* **** */
|
|
10
|
-
jest.mock('../../src/core/DTComponent');
|
|
11
|
-
jest.mock('../../src/core/DTError');
|
|
12
|
-
// Add specific mock for inherited methods to have a basic implementation
|
|
13
|
-
mockOverriddenMethods(DTComponent);
|
|
14
4
|
|
|
15
5
|
/** *********************** TESTS SUITES ****************************** */
|
|
16
|
-
describe('class
|
|
6
|
+
describe('class DTModule', () => {
|
|
17
7
|
let moduleTest: DTModuleTest;
|
|
18
8
|
|
|
19
9
|
beforeEach(() => {
|
|
20
10
|
moduleTest = new DTModuleTest();
|
|
21
|
-
moduleTest.th_set_id(IDTest);
|
|
22
|
-
moduleTest.th_set_key(KeyTest);
|
|
23
11
|
});
|
|
24
12
|
|
|
25
13
|
afterEach(() => {
|
|
@@ -34,7 +22,7 @@ describe('class DYOToolsModule', () => {
|
|
|
34
22
|
|
|
35
23
|
describe('_componentType', () => {
|
|
36
24
|
test('componentType must be "action"', () => {
|
|
37
|
-
expect(moduleTest.
|
|
25
|
+
expect(moduleTest.getComponentType()).toBe('module');
|
|
38
26
|
});
|
|
39
27
|
});
|
|
40
28
|
|
|
@@ -45,21 +33,19 @@ describe('class DYOToolsModule', () => {
|
|
|
45
33
|
|
|
46
34
|
test('simple creation with key', () => {
|
|
47
35
|
const newModule = new DTModuleTest(KeyTest);
|
|
48
|
-
const parentConstructorMock = (DTComponent.prototype.constructor as MockedFunction<(key: string, options: any) => void>).mock;
|
|
49
|
-
|
|
50
|
-
expect(parentConstructorMock.calls.length).toBe(1);
|
|
51
|
-
expect(parentConstructorMock.calls[0][0]).toBe(KeyTest);
|
|
52
36
|
|
|
53
|
-
expect(newModule.
|
|
37
|
+
expect(newModule._getEnabled()).toStrictEqual(true);
|
|
54
38
|
});
|
|
55
39
|
});
|
|
56
40
|
|
|
57
41
|
describe('getMaster()', () => {
|
|
58
42
|
test('call get context with master accessor', () => {
|
|
43
|
+
const getContextSpy = jest.spyOn(moduleTest, 'getContext');
|
|
44
|
+
|
|
59
45
|
moduleTest.getMaster();
|
|
60
46
|
|
|
61
|
-
expect(
|
|
62
|
-
expect(
|
|
47
|
+
expect(getContextSpy.mock.calls.length).toBe(1);
|
|
48
|
+
expect(getContextSpy.mock.calls[0][0]).toBe('master');
|
|
63
49
|
});
|
|
64
50
|
});
|
|
65
51
|
|
|
@@ -71,7 +57,7 @@ describe('class DYOToolsModule', () => {
|
|
|
71
57
|
});
|
|
72
58
|
|
|
73
59
|
test('return false if the module is disabled', () => {
|
|
74
|
-
moduleTest
|
|
60
|
+
moduleTest = new DTModuleTest(IDTest, KeyTest, false);
|
|
75
61
|
|
|
76
62
|
const enabledModule = moduleTest.isEnabled();
|
|
77
63
|
|
|
@@ -81,21 +67,21 @@ describe('class DYOToolsModule', () => {
|
|
|
81
67
|
|
|
82
68
|
describe('enable()', () => {
|
|
83
69
|
test('change enable to true', () => {
|
|
84
|
-
moduleTest
|
|
70
|
+
moduleTest = new DTModuleTest(IDTest, KeyTest, false);
|
|
85
71
|
|
|
86
72
|
moduleTest.enable();
|
|
87
73
|
|
|
88
|
-
expect(moduleTest.
|
|
74
|
+
expect(moduleTest._getEnabled()).toBe(true);
|
|
89
75
|
});
|
|
90
76
|
});
|
|
91
77
|
|
|
92
78
|
describe('disable()', () => {
|
|
93
79
|
test('change enable to false', () => {
|
|
94
|
-
moduleTest
|
|
80
|
+
moduleTest = new DTModuleTest(IDTest, KeyTest, true);
|
|
95
81
|
|
|
96
82
|
moduleTest.disable();
|
|
97
83
|
|
|
98
|
-
expect(moduleTest.
|
|
84
|
+
expect(moduleTest._getEnabled()).toBe(false);
|
|
99
85
|
});
|
|
100
86
|
});
|
|
101
87
|
|
|
@@ -107,7 +93,7 @@ describe('class DYOToolsModule', () => {
|
|
|
107
93
|
});
|
|
108
94
|
|
|
109
95
|
test('string output standard when disabled', () => {
|
|
110
|
-
moduleTest
|
|
96
|
+
moduleTest = new DTModuleTest(IDTest, KeyTest, false);
|
|
111
97
|
|
|
112
98
|
const toStringAction = moduleTest.toString();
|
|
113
99
|
|
|
@@ -127,7 +113,7 @@ describe('class DYOToolsModule', () => {
|
|
|
127
113
|
});
|
|
128
114
|
|
|
129
115
|
test('toObject output standard when disabled', () => {
|
|
130
|
-
moduleTest
|
|
116
|
+
moduleTest = new DTModuleTest(IDTest, KeyTest, false);
|
|
131
117
|
|
|
132
118
|
const toObjectAction: any = moduleTest.toObject();
|
|
133
119
|
|
package/test/core/copy.spec.ts
CHANGED
|
@@ -7,18 +7,9 @@ import {OwnerTest} from './DTComponentPhysical.double';
|
|
|
7
7
|
import {
|
|
8
8
|
BunchMetaData, HaileiMetaData, IMetaDataTest, PlayerMetaData,
|
|
9
9
|
} from './DTComponentWithMeta.double';
|
|
10
|
-
import {
|
|
10
|
+
import { KeyTest } from './DTBunch.double';
|
|
11
11
|
import { DTErrorStub } from './DTError.double';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Special test suite for copy overridden method
|
|
15
|
-
* Unfortunately copy is very hard to mock correctly in Javascript, due to constructor mocks
|
|
16
|
-
* These test doesn't handle the DOC
|
|
17
|
-
* Mock for :
|
|
18
|
-
* - DTBunch
|
|
19
|
-
* - DTElement
|
|
20
|
-
* - DTPlayer
|
|
21
|
-
*/
|
|
12
|
+
import {bunchDefaultOptions} from "../../src/constants";
|
|
22
13
|
|
|
23
14
|
describe('Inherited method copy', () => {
|
|
24
15
|
describe('DTBunch copy()', () => {
|
|
@@ -71,7 +62,7 @@ describe('Inherited method copy', () => {
|
|
|
71
62
|
|
|
72
63
|
expect(bunchCopy.getManyMeta()).toStrictEqual(BunchMetaData);
|
|
73
64
|
expect(bunchCopy.getOptions()).toStrictEqual({
|
|
74
|
-
...
|
|
65
|
+
...bunchDefaultOptions,
|
|
75
66
|
...copiedOptions,
|
|
76
67
|
});
|
|
77
68
|
});
|
|
@@ -156,28 +147,22 @@ describe('Inherited method copy', () => {
|
|
|
156
147
|
|
|
157
148
|
test('copy an element - not copy container', () => {
|
|
158
149
|
const element = new DTElement(KeyTest);
|
|
159
|
-
jest.spyOn(element, 'setContainer').mockImplementation(function (container) {
|
|
160
|
-
this._container = container;
|
|
161
|
-
});
|
|
162
150
|
|
|
163
151
|
element.setContext(new DTComponentStub());
|
|
164
152
|
|
|
165
153
|
const elementCopy = element.copy();
|
|
166
|
-
jest.spyOn(elementCopy, 'getContainer').mockImplementation(function () {
|
|
167
|
-
return this._container;
|
|
168
|
-
});
|
|
169
154
|
|
|
170
155
|
expect(elementCopy.getContainer()).toBeUndefined();
|
|
171
156
|
});
|
|
172
157
|
|
|
173
158
|
test('copy an element - copy meta-data and options', () => {
|
|
174
|
-
const element = new DTElement(KeyTest, { errors: true });
|
|
175
|
-
|
|
159
|
+
const element = new DTElement(KeyTest, { errors: true, syncId: "123" });
|
|
160
|
+
element.setManyMeta(HaileiMetaData);
|
|
176
161
|
|
|
177
162
|
const elementCopy = element.copy();
|
|
178
163
|
|
|
179
164
|
expect(elementCopy.getManyMeta()).toStrictEqual(HaileiMetaData);
|
|
180
|
-
expect(elementCopy.getOptions()).toStrictEqual({ errors: true });
|
|
165
|
+
expect(elementCopy.getOptions()).toStrictEqual({ errors: true, syncId: "123" });
|
|
181
166
|
});
|
|
182
167
|
|
|
183
168
|
test('copy an element - empty errors', () => {
|
|
@@ -206,28 +191,22 @@ describe('Inherited method copy', () => {
|
|
|
206
191
|
|
|
207
192
|
test('copy a player - not copy context', () => {
|
|
208
193
|
const player = new DTPlayer(KeyTest);
|
|
209
|
-
jest.spyOn(player, 'setContext').mockImplementation(function (context) {
|
|
210
|
-
this._context = context;
|
|
211
|
-
});
|
|
212
194
|
|
|
213
195
|
player.setContext(new DTComponentStub());
|
|
214
196
|
|
|
215
197
|
const playerCopy = player.copy();
|
|
216
|
-
jest.spyOn(playerCopy, 'getContext').mockImplementation(function () {
|
|
217
|
-
return this._context;
|
|
218
|
-
});
|
|
219
198
|
|
|
220
199
|
expect(playerCopy.getContext()).toBeUndefined();
|
|
221
200
|
});
|
|
222
201
|
|
|
223
202
|
test('copy a player - copy meta-data and options', () => {
|
|
224
|
-
const player = new DTPlayer(KeyTest, { errors: true });
|
|
225
|
-
|
|
203
|
+
const player = new DTPlayer(KeyTest, { errors: true, syncId: "123" });
|
|
204
|
+
player.setManyMeta(PlayerMetaData);
|
|
226
205
|
|
|
227
206
|
const playerCopy = player.copy();
|
|
228
207
|
|
|
229
208
|
expect(playerCopy.getManyMeta()).toStrictEqual(PlayerMetaData);
|
|
230
|
-
expect(playerCopy.getOptions()).toStrictEqual({ errors: true });
|
|
209
|
+
expect(playerCopy.getOptions()).toStrictEqual({ errors: true, syncId: "123" });
|
|
231
210
|
});
|
|
232
211
|
|
|
233
212
|
test('copy a player - empty errors', () => {
|
package/tsconfig.dev.json
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"
|
|
3
|
+
"target": "es2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
4
6
|
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
5
8
|
"removeComments": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
9
|
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"target": "es2015",
|
|
10
|
-
"sourceMap": true,
|
|
11
10
|
"outDir": "./dist",
|
|
12
|
-
"baseUrl": "./",
|
|
13
11
|
"incremental": true
|
|
14
12
|
},
|
|
15
13
|
"include": [
|
|
16
|
-
"src/**/*.ts"
|
|
17
|
-
"test/**/*.ts"
|
|
14
|
+
"src/**/*.ts"
|
|
18
15
|
],
|
|
19
16
|
"exclude": [
|
|
20
17
|
"node_modules"
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"
|
|
3
|
+
"target": "es2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
4
6
|
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
5
8
|
"removeComments": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
9
|
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"baseUrl": "./",
|
|
13
|
-
"incremental": true
|
|
10
|
+
"outDir": "./dist"
|
|
14
11
|
},
|
|
15
12
|
"include": [
|
|
16
13
|
"src/**/*.ts"
|