|
1 | 1 | import { assert } from "chai"; |
2 | | -import { Yok, injector as globalInjector } from "../lib/common/yok"; |
| 2 | +import { Yok } from "../lib/common/yok"; |
3 | 3 | import { IInjector } from "../lib/common/definitions/yok"; |
4 | 4 | import { inject } from "../lib/common/di"; |
5 | 5 | import { CommandsService } from "../lib/common/services/commands-service"; |
@@ -54,19 +54,18 @@ describe("defineCommand", () => { |
54 | 54 | run: () => undefined, |
55 | 55 | }); |
56 | 56 |
|
57 | | - // The parent dispatcher is synthesized onto the global facade by the |
58 | | - // legacy registry, so registration happens there too. |
59 | | - registerCommandDefinition(definition, globalInjector); |
| 57 | + const testInjector = createTestInjector(); |
| 58 | + registerCommandDefinition(definition, testInjector); |
60 | 59 |
|
61 | | - const command = globalInjector.resolveCommand("dctestwidget|add"); |
| 60 | + const command = testInjector.resolveCommand("dctestwidget|add"); |
62 | 61 | assert.isFunction(command.execute); |
63 | 62 | assert.deepEqual(command.allowedParameters, []); |
64 | 63 |
|
65 | | - const parent = globalInjector.resolveCommand("dctestwidget"); |
| 64 | + const parent = testInjector.resolveCommand("dctestwidget"); |
66 | 65 | assert.isTrue(parent.isHierarchicalCommand); |
67 | 66 |
|
68 | 67 | assert.include( |
69 | | - globalInjector.getRegisteredCommandsNames(false), |
| 68 | + testInjector.getRegisteredCommandsNames(false), |
70 | 69 | "dctestwidget|add", |
71 | 70 | ); |
72 | 71 | }); |
|
0 commit comments