Skip to content

Commit

Permalink
fix issue with usage of should in nodejs 7.2
Browse files Browse the repository at this point in the history
add nodejs 7.x in travis.
  • Loading branch information
erossignon committed Dec 6, 2016
1 parent fc53507 commit fd5e48b
Show file tree
Hide file tree
Showing 43 changed files with 682 additions and 136 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -6,6 +6,8 @@ node_js:
- "4"
- "5"
- "6"
- "7"



before_script:
Expand Down
6 changes: 3 additions & 3 deletions test/address_space/test_address_space.js
Expand Up @@ -96,7 +96,7 @@ describe("testing address space", function () {
//---------------------------------------------------------

// object shall not be found with a global nodeId search
should(addressSpace.findNode(object.nodeId)).eql(undefined);
should.not.exist(addressSpace.findNode(object.nodeId));

// object shall not be found in parent folder anymore
references = rootFolder.findReferences("Organizes", true);
Expand Down Expand Up @@ -130,8 +130,8 @@ describe("testing address space", function () {
//---------------------------------------------------------

// object shall not be found with a global nodeId search
should(addressSpace.findNode(object.nodeId)).eql(undefined);
should(addressSpace.findNode(innerVar.nodeId)).eql(undefined);
should.not.exist(addressSpace.findNode(object.nodeId));
should.not.exist(addressSpace.findNode(innerVar.nodeId));

references = rootFolder.findReferences("Organizes", true);
findReference(references, object.nodeId).length.should.eql(0);
Expand Down
10 changes: 6 additions & 4 deletions test/address_space/test_address_space_add_object_type.js
@@ -1,3 +1,5 @@


"use strict";
/* global describe,it,before*/
require("requirish")._(module);
Expand Down Expand Up @@ -84,10 +86,10 @@ describe("testing add new ObjectType ", function () {

// perform some verification on temperatureSensorType
var temperatureSensorType = addressSpace.findObjectType("TemperatureSensorType");
should(temperatureSensorType.temperature).not.eql(0);
should.exist(temperatureSensorType.temperature);

var temperatureSensor = temperatureSensorType.instantiate({organizedBy: "RootFolder", browseName: "Test"});
should(temperatureSensor.temperature).not.eql(0);
should.exist(temperatureSensor.temperature);

// perform some verification
var baseDataVariableType = addressSpace.findVariableType("BaseDataVariableType");
Expand Down Expand Up @@ -132,9 +134,9 @@ describe("testing add new ObjectType ", function () {
});

specialSensor.should.have.property("typeDefinitionObj");
specialSensor.should.not.have.property("subtypeOfObj", "Object should not have SubType");
//xx should.not.exist(specialSensor.subtypeOfObj);//, "Object should not have SubType");
specialSensor.typeDefinitionObj.browseName.toString().should.eql("SpecialTemperatureSensorType");
should(specialSensor.temperature).not.eql(0);
should.exist(specialSensor.temperature);

//xx console.log("done");
done();
Expand Down
Expand Up @@ -58,7 +58,7 @@ describe("testing add TwoStateVariable ", function () {
node.dataTypeObj.browseName.toString().should.eql("LocalizedText");
node.valueRank.should.eql(0);

should(node.transitionTime).eql(undefined);
should.not.exist(node.transitionTime);

node.readValue().statusCode.should.eql(StatusCodes.UncertainInitialValue);

Expand Down Expand Up @@ -98,7 +98,7 @@ describe("testing add TwoStateVariable ", function () {
node.dataTypeObj.browseName.toString().should.eql("LocalizedText");
node.valueRank.should.eql(0);

should(node.transitionTime).eql(undefined);
should.not.exist(node.transitionTime);

node.setValue(true);
node.readValue().value.value.text.should.eql("Enabled");
Expand All @@ -113,7 +113,7 @@ describe("testing add TwoStateVariable ", function () {
browseName: "TwoStateVariable2",
optionals:["TransitionTime"]
});
should(node.transitionTime).not.eql(undefined);
should.exist(node.transitionTime);

this.clock.tick(100);
node.setValue(true);
Expand Down Expand Up @@ -186,7 +186,7 @@ describe("testing add TwoStateVariable ", function () {
browseName: "TwoStateVariable2",
optionals: ["EffectiveTransitionTime","TransitionTime", "EffectiveDisplayName"]
});
should(mainState.effectiveTransitionTime).not.eql(undefined);
should.exist(mainState.effectiveTransitionTime);

var subState = addressSpace.addTwoStateVariable({
browseName: "TwoStateVariableSub",
Expand Down

0 comments on commit fd5e48b

Please sign in to comment.