Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bitdiver/model

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitdiver/model - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

tests/EnvironmentRunTest.js

7

lib/EnvironmentTestcase.js

@@ -44,2 +44,9 @@ 'use strict';

this.map = new _map2.default();
// This is set by the runner. The number of this test case in the list of all the test cases
// Start with '1'
this.countCurrent = 0;
// This is set by the runner. How many test cases to be excuted in this run
this.countAll = 0;
}

@@ -46,0 +53,0 @@

25

lib/LogAdapter.js

@@ -17,3 +17,3 @@ 'use strict';

const LEVEL_INFO = exports.LEVEL_INFO = 'info';
const LEVEL_WARNING = exports.LEVEL_WARNING = 'warn';
const LEVEL_WARNING = exports.LEVEL_WARNING = 'warning';
const LEVEL_ERROR = exports.LEVEL_ERROR = 'error';

@@ -47,2 +47,4 @@ const LEVEL_FATAL = exports.LEVEL_FATAL = 'fatal';

* tc:{
* tcCountCurrent: tcCountCurrent,
* tcCountAll: tcCountAll,
* id: 'id',

@@ -52,2 +54,4 @@ * name: 'great tc name'

* step:{
* stepCountCurrent: stepCountCurrent,
* stepCountAll: stepCountAll,
* id: 'id',

@@ -69,2 +73,3 @@ * name: 'great step name'

const data = logMessage.data;
const logLevel = logMessage.logLevel;

@@ -79,27 +84,27 @@ // Set the time of the log

// this is a step log
return this._logStep(meta, data);
return this._logStep(meta, data, logLevel);
} else if (meta.tc !== undefined && meta.tc.id !== undefined) {
// This is a testcase log
return this._logTestcase(meta, data);
return this._logTestcase(meta, data, logLevel);
}
// This is a run log
return this._logRun(meta, data);
return this._logRun(meta, data, logLevel);
}
async _logRun(meta, data) {
async _logRun(meta, data, logLevel) {
// eslint-disable-next-line no-console
console.log('Run: ', `\n${data}`);
console.log('Run: ', `\n${{ data, logLevel }}`);
}
async _logTestcase(meta, data) {
async _logTestcase(meta, data, logLevel) {
const testcaseName = meta.tc.name;
// eslint-disable-next-line no-console
console.log('Test case: ', `${testcaseName}:\n${data}`);
console.log('Test case: ', `${testcaseName}:\n${{ data, logLevel }}`);
}
async _logStep(meta, data) {
async _logStep(meta, data, logLevel) {
const testcaseName = meta.tc.name;
const stepName = meta.step.name;
// eslint-disable-next-line no-console
console.log('Step: ', `${testcaseName}->${stepName}:\n${data}`);
console.log('Step: ', `${testcaseName}->${stepName}:\n${{ data, logLevel }}`);
}

@@ -106,0 +111,0 @@ }

37

lib/LogAdapterMemory.js

@@ -69,7 +69,9 @@ 'use strict';

prepareTestcase(runId, testcaseName) {
prepareTestcase(runId, testcaseName, meta) {
if (this.logs[runId].testcases[testcaseName] === undefined) {
this.logs[runId].testcases[testcaseName] = {
logs: [],
steps: {}
steps: {},
countCurrent: meta.tc.countCurrent,
countAll: meta.tc.countAll
};

@@ -79,9 +81,9 @@ }

async _logRun(meta, data) {
async _logRun(meta, data, logLevel) {
const runId = meta.run.id;
this.prepareRun(runId);
this.logs[runId].logs.push(data);
this.logs[runId].logs.push({ data, logLevel });
}
async _logTestcase(meta, data) {
async _logTestcase(meta, data, logLevel) {
const runId = meta.run.id;

@@ -91,8 +93,13 @@ const testcaseName = meta.tc.name;

this.prepareRun(runId);
this.prepareTestcase(runId, testcaseName);
this.prepareTestcase(runId, testcaseName, meta);
this.logs[runId].testcases[testcaseName].logs.push(data);
this.logs[runId].testcases[testcaseName].logs.push({
data,
logLevel,
countCurrent: meta.tc.countCurrent,
countAll: meta.tc.countAll
});
}
async _logStep(meta, data) {
async _logStep(meta, data, logLevel) {
const runId = meta.run.id;

@@ -103,8 +110,9 @@ const testcaseName = meta.tc.name;

this.prepareRun(runId);
this.prepareTestcase(runId, testcaseName);
this.prepareTestcase(runId, testcaseName, meta);
if (this.logs[runId].testcases[testcaseName] === undefined) {
this.logs[runId].testcases[testcaseName] = {
logs: [],
steps: {}
steps: {},
countCurrent: meta.tc.countCurrent,
countAll: meta.tc.countAll
};

@@ -117,3 +125,8 @@ }

}
this.logs[runId].testcases[testcaseName].steps[stepName].logs.push(data);
this.logs[runId].testcases[testcaseName].steps[stepName].logs.push({
data,
logLevel,
countCurrent: meta.step.countCurrent,
countAll: meta.step.countAll
});
}

@@ -120,0 +133,0 @@

@@ -66,2 +66,9 @@ 'use strict';

this.data = undefined;
// This is set by the runner. The number of this step in the list of all the steps
// Start with '1'
this.countCurrent = 0;
// This is set by the runner. How many steps to be excuted in this run
this.countCurrent = 0;
}

@@ -150,2 +157,4 @@

step: {
countCurrent: this.countCurrent,
countAll: this.countAll,
id: this.stepInstanceId,

@@ -158,5 +167,6 @@ name: this.name,

};
if (this.type === STEP_TYPE_NORMAL) {
meta.tc = {
countAll: this.environmentTestcase.countAll,
countCurrent: this.environmentTestcase.countCurrent,
id: this.environmentTestcase.id,

@@ -176,2 +186,4 @@ name: this.environmentTestcase.name

meta.tc = {
countAll: tcEnv.countAll,
countCurrent: tcEnv.countCurrent,
id: tcEnv.id,

@@ -178,0 +190,0 @@ name: tcEnv.name

@@ -1,1 +0,1 @@

{"name":"@bitdiver/model","version":"1.0.1","description":"","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/bitdiver/model.git"},"bugs":{"url":"https://github.com/bitdiver/model/issues"},"homepage":"https://github.com/bitdiver/model#readme","scripts":{"build":"npm run src_format && npm run src_lint && babel src -d lib","src_lint":"eslint src tests","src_format":"prettier --no-semi --single-quote --trailing-comma es5 --write \"{src,tests}/**/*.js\"","test_only":"jest","test":"npm run src_format && npm run src_lint && npm run build && jest -c jest.config.json","semantic-release":"semantic-release pre && npm publish --access public && semantic-release post","debug":"npm run build && node --inspect-brk ./node_modules/.bin/jest -i --config=./jest.config.json","prepublish":"npm run build"},"contributors":[{"name":"Torsten Link","email":"torstenlink@gmx.de"},{"name":"Markus Felten","email":"markus.felten@gmx.de"}],"license":"ISC","devDependencies":{"assert":"^1.4.1","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-eslint":"^8.0.2","babel-jest":"^21.2.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cz-conventional-changelog":"^2.1.0","eslint":"^4.12.1","eslint-config-prettier":"^2.9.0","eslint-plugin-babel":"^4.0.0","jest":"^21.2.1","jest-cli":"^21.2.1","jest-environment-node-debug":"^2.0.0","prettier":"^1.8.2","regenerator-runtime":"^0.11.0","semantic-release":"^8.2.3"},"dependencies":{"uuid":"^3.1.0"}}
{"name":"@bitdiver/model","version":"1.0.2","description":"","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/bitdiver/model.git"},"bugs":{"url":"https://github.com/bitdiver/model/issues"},"homepage":"https://github.com/bitdiver/model#readme","scripts":{"build":"npm run src_format && npm run src_lint && babel src -d lib","src_lint":"eslint src tests","src_format":"prettier --no-semi --single-quote --trailing-comma es5 --write \"{src,tests}/**/*.js\"","test_only":"jest","test":"npm run src_format && npm run src_lint && npm run build && jest -c jest.config.json","semantic-release":"semantic-release pre && npm publish --access public && semantic-release post","debug":"npm run build && node --inspect-brk ./node_modules/.bin/jest -i --config=./jest.config.json","prepublish":"npm run build"},"contributors":[{"name":"Torsten Link","email":"torstenlink@gmx.de"},{"name":"Markus Felten","email":"markus.felten@gmx.de"}],"license":"ISC","devDependencies":{"assert":"^1.4.1","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-eslint":"^8.0.2","babel-jest":"^21.2.0","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.6.1","babel-preset-flow":"^6.23.0","babel-register":"^6.26.0","cz-conventional-changelog":"^2.1.0","eslint":"^4.12.1","eslint-config-prettier":"^2.9.0","eslint-plugin-babel":"^4.0.0","jest":"^21.2.1","jest-cli":"^21.2.1","jest-environment-node-debug":"^2.0.0","prettier":"^1.8.2","regenerator-runtime":"^0.11.0","semantic-release":"^8.2.3"},"dependencies":{"uuid":"^3.1.0"}}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc