@functions-api/core
Advanced tools
Comparing version 0.0.8 to 0.0.9
const Errors = require('../errors.js') | ||
const Logger = require('../logger.js') | ||
const staticLogger = new Logger() | ||
module.exports = class AbstractHandler { | ||
class AbstractHandler { | ||
init (providedOptions) { | ||
@@ -69,3 +68,3 @@ this.options = { ...providedOptions } | ||
staticLogger.error(`Fatal Error ${e}`) | ||
AbstractHandler.logger.error(`Fatal Error ${e}`) | ||
throw e | ||
@@ -82,2 +81,5 @@ } | ||
} | ||
} | ||
} | ||
AbstractHandler.logger = new Logger() | ||
module.exports = AbstractHandler |
{ | ||
"name": "@functions-api/core", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "A small framework for building APIs as functions (to run in a FaaS, like Lambda)", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -7,3 +7,5 @@ const TestHandler = require('./test-handler.js') | ||
describe('initialization', () => { | ||
test('it has a logger instance on the base class', () => { | ||
expect(AbstractHandler).toHaveProperty('logger') | ||
}) | ||
}) | ||
@@ -10,0 +12,0 @@ |
@@ -8,2 +8,6 @@ const TestHandler = require('./test-handler.js') | ||
const BodyHandler = AbstractBodyHandler(TestHandler) | ||
test('it has a logger instance on the base class', () => { | ||
expect(BodyHandler).toHaveProperty('logger') | ||
}) | ||
@@ -10,0 +14,0 @@ test('throws an error if no body is defined', () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17294
427