Skip to content

Commit

Permalink
feature: add nock to test without context broker telefonicaid#81
Browse files Browse the repository at this point in the history
  • Loading branch information
vraybaud committed Jun 16, 2020
1 parent b6e3b50 commit 2d123e4
Show file tree
Hide file tree
Showing 12 changed files with 363 additions and 187 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"logops": "2.1.0"
},
"devDependencies": {
"nock":"14.4.0",
"coveralls": "~3.0.2",
"husky": "~1.1.0",
"jshint": "~2.9.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp3",
"attributes": [
{
"name": "time",
"type": "String",
"value": "1430909015"
},
{
"name": "statin",
"type": "String",
"value": "0A5F"
},
{
"name": "lng",
"type": "String",
"value": "-4"
},
{
"name": "lat",
"type": "String",
"value": "41"
},
{
"name": "campo1",
"type": "Integer",
"value": "valor1"
},
{
"name": "campo2",
"type": "Integer",
"value": 64
}
]
}
],
"updateAction": "UPDATE"
}
57 changes: 57 additions & 0 deletions test/examples/deviceProvisioning/expectedDataUpdateRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp2",
"attributes": [
{
"name": "time",
"type": "String",
"value": "1430909015"
},
{
"name": "statin",
"type": "String",
"value": "0A5F"
},
{
"name": "lng",
"type": "String",
"value": "-4"
},
{
"name": "lat",
"type": "String",
"value": "41"
},
{
"name": "theCounter",
"type": "Integer",
"value": 2
},
{
"name": "theParam1",
"type": "Integer",
"value": 0
},
{
"name": "param2",
"type": "Integer",
"value": 0
},
{
"name": "tempDegreesCelsius",
"type": "Integer",
"value": 35
},
{
"name": "voltage",
"type": "Integer",
"value": 3183
}
]
}
],
"updateAction": "UPDATE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp3",
"attributes": [
{
"name": "time",
"type": "String",
"value": " "
},
{
"name": "statin",
"type": "String",
"value": " "
},
{
"name": "lng",
"type": "String",
"value": " "
},
{
"name": "lat",
"type": "String",
"value": " "
},
{
"name": "campo1",
"type": "Integer",
"value": " "
},
{
"name": "campo2",
"type": "Integer",
"value": " "
}
]
}
],
"updateAction": "APPEND"
}
57 changes: 57 additions & 0 deletions test/examples/deviceProvisioning/expectedProvisioningRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp2",
"attributes": [
{
"name": "time",
"type": "String",
"value": " "
},
{
"name": "statin",
"type": "String",
"value": " "
},
{
"name": "lng",
"type": "String",
"value": " "
},
{
"name": "lat",
"type": "String",
"value": " "
},
{
"name": "theCounter",
"type": "Integer",
"value": " "
},
{
"name": "theParam1",
"type": "Integer",
"value": " "
},
{
"name": "param2",
"type": "Integer",
"value": " "
},
{
"name": "tempDegreesCelsius",
"type": "Integer",
"value": " "
},
{
"name": "voltage",
"type": "Integer",
"value": " "
}
]
}
],
"updateAction": "APPEND"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "SIGFOX:sigApp1",
"attributes": [
{
"name": "time",
"type": "String",
"value": " "
},
{
"name": "statin",
"type": "String",
"value": " "
},
{
"name": "lng",
"type": "String",
"value": " "
},
{
"name": "lat",
"type": "String",
"value": " "
},
{
"name": "counter",
"type": "Integer",
"value": " "
},
{
"name": "param1",
"type": "Integer",
"value": " "
},
{
"name": "param2",
"type": "Integer",
"value": " "
},
{
"name": "tempDegreesCelsius",
"type": "Integer",
"value": " "
},
{
"name": "voltage",
"type": "Integer",
"value": " "
}
]
}
],
"updateAction": "APPEND"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "SIGFOX:sigApp1",
"attributes": [
{
"name": "time",
"type": "String",
"value": "1430909015"
},
{
"name": "statin",
"type": "String",
"value": "0A5F"
},
{
"name": "lng",
"type": "String",
"value": "-4"
},
{
"name": "lat",
"type": "String",
"value": "41"
},
{
"name": "counter",
"type": "Integer",
"value": 2
},
{
"name": "param1",
"type": "Integer",
"value": 0
},
{
"name": "param2",
"type": "Integer",
"value": 0
},
{
"name": "tempDegreesCelsius",
"type": "Integer",
"value": 35
},
{
"name": "voltage",
"type": "Integer",
"value": 3183
}
]
}
],
"updateAction": "UPDATE"
}
2 changes: 1 addition & 1 deletion test/testConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ config.sigfox = {
};

config.iota = {
logLevel: 'FATAL',
logLevel: 'DEBUG',
contextBroker: {
host: 'localhost',
port: '10026'
Expand Down
Loading

0 comments on commit 2d123e4

Please sign in to comment.