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

ci-logger

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ci-logger - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

junit.xml

62

.eslintrc.json

@@ -14,4 +14,6 @@ {

"plugins": ["jest"],
"reportUnusedDisableDirectives": true,
"rules": {
"array-bracket-spacing": "warn",
"array-callback-return": "warn",
"block-scoped-var": 1,

@@ -21,13 +23,29 @@ "block-spacing": "warn",

"camelcase": ["warn", { "properties": "never" }],
"comma-spacing": ["error", { "before": false, "after": true }],
"complexity": ["warn", 20],
"computed-property-spacing": ["warn", "never"],
"curly": "warn",
"default-case": "warn",
"default-param-last": "error",
"eqeqeq": ["error", "always"],
"func-call-spacing": ["warn", "never"],
"indent": ["error", 4, { "SwitchCase": 1 }],
"key-spacing": "warn",
"keyword-spacing": ["warn", { "before": true, "after": true }],
"max-depth": ["error", { "max": 5 }],
"max-nested-callbacks": ["error", { "max": 10 }],
"new-parens": "error",
"no-alert": "error",
"no-array-constructor": "error",
"no-console": "off",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "warn",
"no-eq-null": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-fallthrough": "error",
"no-implicit-globals": "off",
"no-implied-eval": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",

@@ -37,17 +55,59 @@ "no-loop-func": "error",

"no-mixed-spaces-and-tabs": "warn",
"no-multi-assign": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-new": "error",
"no-new-object": "error",
"no-param-reassign": ["error", { "props": false }],
"no-path-concat": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "warn",
"no-use-before-define": ["error", { "functions": false }],
"no-useless-concat": "error",
"no-useless-return": "error",
"no-var": "error",
"no-warning-comments": "error",
"no-whitespace-before-property": "error",
"operator-assignment": "warn",
"prefer-const": "error",
"prefer-regex-literals": "error",
"quotes": ["error", "single"],
"require-await": "error",
"semi": ["error", "always"],
"semi-spacing": "error",
"space-before-blocks": ["warn", "always"],
"space-before-function-paren": ["warn", "never"],
"space-in-parens": ["warn", "never"],
"strict": "error"
"spaced-comment": ["warn", "always"],
"strict": "error",
"wrap-iife": "error",
"yoda": "error",
"jest/consistent-test-it": ["error", {"fn": "it", "withinDescribe": "it"}],
"jest/lowercase-name": "error",
"jest/no-duplicate-hooks": "error",
"jest/no-commented-out-tests": "warn",
"jest/no-empty-title": "warn",
"jest/no-export": "error",
"jest/no-if": "warn",
"jest/no-mocks-import": "error",
"jest/no-test-callback": "error",
"jest/no-truthy-falsy": "warn",
"jest/no-try-expect": "error",
"jest/prefer-called-with": "warn",
"jest/prefer-strict-equal": "warn",
"jest/prefer-to-be-null": "warn",
"jest/prefer-to-be-undefined": "warn",
"jest/prefer-to-contain": "warn",
"jest/prefer-to-have-length": "warn",
"jest/prefer-todo": "warn",
"jest/require-top-level-describe": "error",
"jest/require-tothrow-message": "error"
},
"root": true
}
# Changelog
## v1.0.1 (2019-10-23)
### Fixed
- Updated to latest dependencies
## v1.0.0 (2019-06-16)
Initial release

2

index.js

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

default:
logMethod = console.log;
logMethod = console.log;
break;

@@ -55,0 +55,0 @@ }

{
"name": "ci-logger",
"version": "1.0.0",
"version": "1.0.1",
"description": "Very simple logger for CI environments.",

@@ -8,3 +8,4 @@ "main": "index.js",

"start": "node index.js",
"test": "jest --ci"
"test": "jest --ci",
"lint": "eslint **/*.js"
},

@@ -27,5 +28,6 @@ "repository": {

"devDependencies": {
"eslint": "^5.16.0",
"eslint-plugin-jest": "^22.6.4",
"jest": "^24.8.0"
"eslint": "^6.5.1",
"eslint-plugin-jest": "^22.19.0",
"jest": "^24.9.0",
"jest-junit": "^8.0.0"
},

@@ -38,10 +40,16 @@ "jest": {

],
"coverageReporters": [
"json",
"text",
"clover"
],
"verbose": true,
"reporters": [
"default",
[
"jest-junit",
{
"suiteNameTemplate": "{filename}",
"classNameTemplate": "{classname}",
"titleTemplate": "{title}"
}
]
],
"verbose": true,
"testEnvironment": "node"
}
}

@@ -15,8 +15,8 @@ 'use strict';

it('should throw in invalid args provided', () => {
expect(() => logger.getLogEntry()).toThrow();
it('should throw if invalid args provided', () => {
expect(() => logger.getLogEntry()).toThrow(/Invalid log data/);
});
it('should throw if args has invalid message', () => {
expect(() => logger.getLogEntry({})).toThrow();
expect(() => logger.getLogEntry({})).toThrow(/Invalid log message/);
});

@@ -26,4 +26,4 @@

const logInput = {message: message};
let logEntry = logger.getLogEntry(logInput);
expect(logEntry.message).toEqual(logInput.message);
const logEntry = logger.getLogEntry(logInput);
expect(logEntry.message).toStrictEqual(logInput.message);
});

@@ -39,3 +39,3 @@

const logEntry = logger.getLogEntry(logInput);
expect(logEntry.errorCode).toEqual(logInput.errorCode);
expect(logEntry.errorCode).toStrictEqual(logInput.errorCode);
});

@@ -46,3 +46,3 @@

const logEntry = logger.getLogEntry(logInput);
expect(logEntry.errorCode).toEqual(logEntryDefaults.errorCode);
expect(logEntry.errorCode).toStrictEqual(logEntryDefaults.errorCode);
});

@@ -53,11 +53,11 @@

let logEntry = logger.getLogEntry(logInput);
expect(logEntry.level).toEqual(logInput.level);
expect(logEntry.level).toStrictEqual(logInput.level);
logInput.level = logger.levels.warn;
logEntry = logger.getLogEntry(logInput);
expect(logEntry.level).toEqual(logInput.level);
expect(logEntry.level).toStrictEqual(logInput.level);
logInput.level = logger.levels.error;
logEntry = logger.getLogEntry(logInput);
expect(logEntry.level).toEqual(logInput.level);
expect(logEntry.level).toStrictEqual(logInput.level);
});

@@ -68,3 +68,3 @@

const logEntry = logger.getLogEntry(logInput);
expect(logEntry.level).toEqual(logEntryDefaults.level);
expect(logEntry.level).toStrictEqual(logEntryDefaults.level);
});

@@ -75,3 +75,3 @@

const logEntry = logger.getLogEntry(logInput);
expect(logEntry.level).toEqual(logEntryDefaults.level);
expect(logEntry.level).toStrictEqual(logEntryDefaults.level);
});

@@ -82,7 +82,7 @@

let logEntry = logger.getLogEntry(logInput);
expect(logEntry.exitOnError).toEqual(logInput.exitOnError);
expect(logEntry.exitOnError).toStrictEqual(logInput.exitOnError);
logInput.exitOnError = false;
logEntry = logger.getLogEntry(logInput);
expect(logEntry.exitOnError).toEqual(logInput.exitOnError);
expect(logEntry.exitOnError).toStrictEqual(logInput.exitOnError);
});

@@ -93,3 +93,3 @@

const logEntry = logger.getLogEntry(logInput);
expect(logEntry.exitOnError).toEqual(logEntryDefaults.exitOnError);
expect(logEntry.exitOnError).toStrictEqual(logEntryDefaults.exitOnError);
});

@@ -99,4 +99,4 @@

const logInput = {message: message, exitOnError: 'blue'};
let logEntry = logger.getLogEntry(logInput);
expect(logEntry.exitOnError).toEqual(logEntryDefaults.exitOnError);
const logEntry = logger.getLogEntry(logInput);
expect(logEntry.exitOnError).toStrictEqual(logEntryDefaults.exitOnError);
});

@@ -107,7 +107,7 @@

let logEntry = logger.getLogEntry(logInput);
expect(logEntry.isResult).toEqual(logInput.isResult);
expect(logEntry.isResult).toStrictEqual(logInput.isResult);
logInput.isResult = false;
logEntry = logger.getLogEntry(logInput);
expect(logEntry.isResult).toEqual(logInput.isResult);
expect(logEntry.isResult).toStrictEqual(logInput.isResult);
});

@@ -118,3 +118,3 @@

const logEntry = logger.getLogEntry(logInput);
expect(logEntry.isResult).toEqual(logEntryDefaults.isResult);
expect(logEntry.isResult).toStrictEqual(logEntryDefaults.isResult);
});

@@ -124,4 +124,4 @@

const logInput = {message: message, isResult: 'blue'};
let logEntry = logger.getLogEntry(logInput);
expect(logEntry.isResult).toEqual(logEntryDefaults.isResult);
const logEntry = logger.getLogEntry(logInput);
expect(logEntry.isResult).toStrictEqual(logEntryDefaults.isResult);
});

@@ -154,3 +154,3 @@ });

const result = logWithSpies(logEntry);
expect(result.consoleLogSpy).toHaveBeenCalled();
expect(result.consoleLogSpy).toHaveBeenCalled(); // eslint-disable-line jest/prefer-called-with
});

@@ -161,3 +161,3 @@

const result = logWithSpies(logEntry);
expect(result.consoleWarnSpy).toHaveBeenCalled();
expect(result.consoleWarnSpy).toHaveBeenCalled(); // eslint-disable-line jest/prefer-called-with
});

@@ -168,3 +168,3 @@

const result = logWithSpies(logEntry);
expect(result.consoleErrorSpy).toHaveBeenCalled();
expect(result.consoleErrorSpy).toHaveBeenCalled(); // eslint-disable-line jest/prefer-called-with
expect(result.processExitSpy).toHaveBeenCalledWith(logEntry.errorCode);

@@ -176,3 +176,3 @@ });

const result = logWithSpies(logEntry);
expect(result.consoleErrorSpy).toHaveBeenCalled();
expect(result.consoleErrorSpy).toHaveBeenCalled(); // eslint-disable-line jest/prefer-called-with
expect(result.processExitSpy).not.toHaveBeenCalled();

@@ -184,7 +184,7 @@ });

const result = logWithSpies(logEntry);
expect(result.consoleWarnSpy).toHaveBeenCalled();
expect(result.consoleWarnSpy).toHaveBeenCalled(); // eslint-disable-line jest/prefer-called-with
expect(result.processExitSpy).not.toHaveBeenCalled();
});
// Rather than test the specific formatting, ensure that the formatted
// Rather than test the specific formatting, ensure that the formatted
// message contains the original message, but with some augmentation

@@ -196,3 +196,3 @@ it('should format message if isResult is true', () => {

expect(loggedMessage).toMatch(logEntry.message);
expect(loggedMessage).not.toEqual(logEntry.message);
expect(loggedMessage).not.toStrictEqual(logEntry.message);
});

@@ -204,4 +204,4 @@

const loggedMessage = result.consoleLogSpy.mock.calls[0][0];
expect(loggedMessage).toEqual(logEntry.message);
expect(loggedMessage).toStrictEqual(logEntry.message);
});
});

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

const testReturnsValue = (value, defaultValue) => {
expect(utils.getBooleanOrDefault(value, defaultValue)).toEqual(value);
expect(utils.getBooleanOrDefault(value, defaultValue)).toStrictEqual(value);
};
const testReturnsDefault = (value, defaultValue) => {
expect(utils.getBooleanOrDefault(value, defaultValue)).toEqual(defaultValue);
expect(utils.getBooleanOrDefault(value, defaultValue)).toStrictEqual(defaultValue);
};

@@ -32,3 +32,3 @@

it('should return default for zero', () => {
testReturnsDefault(0, true); // eslint-disable-line no-magic-numbers
testReturnsDefault(0, true);
});

@@ -53,7 +53,7 @@

const testReturnsValue = (value, defaultValue) => {
expect(utils.getIntegerOrDefault(value, defaultValue)).toEqual(value);
expect(utils.getIntegerOrDefault(value, defaultValue)).toStrictEqual(value);
};
const testReturnsDefault = (value, defaultValue) => {
expect(utils.getIntegerOrDefault(value, defaultValue)).toEqual(defaultValue);
expect(utils.getIntegerOrDefault(value, defaultValue)).toStrictEqual(defaultValue);
};

@@ -70,3 +70,3 @@

it('should return value for zero', () => {
testReturnsValue(0, defaultInteger); // eslint-disable-line no-magic-numbers
testReturnsValue(0, defaultInteger);
});

@@ -73,0 +73,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