Skip to content

Commit

Permalink
fix minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Nov 12, 2023
1 parent ff70927 commit 0243c5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/node-opcua-address-space/test/test_browse_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("testing address space", () => {
addressSpace.dispose();
});

it("should dump references", (done: any) => {
it("should dump references", (done) => {
const references = addressSpace.rootFolder.findReferencesEx("References", BrowseDirection.Forward);
redirectToFile(
"dumpReferences.log",
Expand All @@ -30,7 +30,7 @@ describe("testing address space", () => {
);
});

it("should dump a browseDescription", (done: any) => {
it("should dump a browseDescription", (done) => {
const browseDescription: BrowseDescriptionOptions = {
browseDirection: BrowseDirection.Both,
includeSubtypes: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,44 +36,44 @@ describe("Test object instantiate multi", () => {
function getCoffeeMachineDeviceType(addressSpace: IAddressSpace) {
const nsKitchen = addressSpace.getNamespaceIndex("http://opcfoundation.org/UA/CommercialKitchenEquipment/");
nsKitchen.should.be.greaterThanOrEqual(0);
const coffeeManicheDeviceType = addressSpace.findObjectType("CoffeeMachineDeviceType", nsKitchen)!;
should.exists(coffeeManicheDeviceType);
const coffeeMachineDeviceType = addressSpace.findObjectType("CoffeeMachineDeviceType", nsKitchen)!;
should.exists(coffeeMachineDeviceType);

const deviceSet = addressSpace.findNode("ns=2;i=5001");
if (!deviceSet) throw new Error("Cannot find device set node");

return { deviceSet, coffeeManicheDeviceType };
return { deviceSet, coffeeMachineDeviceType: coffeeMachineDeviceType };
}

it("should be possible to instantiate 2 objects - registerSymbolicNames = false", () => {
const { coffeeManicheDeviceType, deviceSet } = getCoffeeMachineDeviceType(addressSpace);
const coffeeMachine1 = coffeeManicheDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
const coffeeMachine2 = coffeeManicheDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
const { coffeeMachineDeviceType, deviceSet } = getCoffeeMachineDeviceType(addressSpace);
const coffeeMachine1 = coffeeMachineDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
const coffeeMachine2 = coffeeMachineDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
});

it("should be possible to instantiate 2 objects - registerSymbolicNames = true", async () => {
const ns = addressSpace.getOwnNamespace();

setSymbols(ns, []);

const { coffeeManicheDeviceType, deviceSet } = getCoffeeMachineDeviceType(addressSpace);
const coffeeMachine1 = coffeeManicheDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
const coffeeMachine2 = coffeeManicheDeviceType.instantiate({ browseName: "Machine2", organizedBy: deviceSet });
const { coffeeMachineDeviceType, deviceSet } = getCoffeeMachineDeviceType(addressSpace);
const coffeeMachine1 = coffeeMachineDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
const coffeeMachine2 = coffeeMachineDeviceType.instantiate({ browseName: "Machine2", organizedBy: deviceSet });

const theSymbols = getSymbols(ns);
console.log(getSymbols(ns));

{
const addressSpace2 = await buildAddressSpace();
const ns2 = addressSpace.getOwnNamespace();
const { coffeeManicheDeviceType, deviceSet } = getCoffeeMachineDeviceType(addressSpace2);
const { coffeeMachineDeviceType: coffeeMachineDeviceType, deviceSet } = getCoffeeMachineDeviceType(addressSpace2);

setSymbols(ns2, theSymbols);

// let's buiild in a diffiernt order !!
const coffeeMachine2 = coffeeManicheDeviceType.instantiate({ browseName: "Machine2", organizedBy: deviceSet });
const coffeeMachine2 = coffeeMachineDeviceType.instantiate({ browseName: "Machine2", organizedBy: deviceSet });

const coffeeMachine1 = coffeeManicheDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });
const coffeeMachine1 = coffeeMachineDeviceType.instantiate({ browseName: "Machine1", organizedBy: deviceSet });

console.log(getSymbols(ns2));
getSymbols(ns2).should.eql(theSymbols, "symbols should not be affected");
Expand Down

0 comments on commit 0243c5a

Please sign in to comment.