node-red
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const should = require("should");
|
||||
const NR_TEST_UTILS = require("nr-test-utils");
|
||||
|
||||
const api = NR_TEST_UTILS.require("@node-red/runtime/lib/telemetry/metrics/01-core");
|
||||
|
||||
describe("telemetry metrics/01-core", function() {
|
||||
|
||||
it('reports core metrics', function () {
|
||||
const result = api({
|
||||
settings: {
|
||||
get: key => { return {instanceId: "1234"}[key]}
|
||||
}
|
||||
})
|
||||
result.should.have.property("instanceId", "1234")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,14 @@
|
||||
const should = require("should");
|
||||
const NR_TEST_UTILS = require("nr-test-utils");
|
||||
|
||||
const api = NR_TEST_UTILS.require("@node-red/runtime/lib/telemetry/metrics/02-os");
|
||||
|
||||
describe("telemetry metrics/02-os", function() {
|
||||
|
||||
it('reports os metrics', function () {
|
||||
const result = api()
|
||||
result.should.have.property("os.type")
|
||||
result.should.have.property("os.release")
|
||||
result.should.have.property("os.arch")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,17 @@
|
||||
const should = require("should");
|
||||
const NR_TEST_UTILS = require("nr-test-utils");
|
||||
|
||||
const api = NR_TEST_UTILS.require("@node-red/runtime/lib/telemetry/metrics/03-env");
|
||||
|
||||
describe("telemetry metrics/03-env", function() {
|
||||
|
||||
it('reports env metrics', function () {
|
||||
const result = api({
|
||||
settings: {
|
||||
version: '1.2.3'
|
||||
}
|
||||
})
|
||||
result.should.have.property("env.nodejs", process.version.replace(/^v/, ''))
|
||||
result.should.have.property("env.node-red", '1.2.3')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user