From 3b0988074c10f460eb3e0a68819529eb3300f25b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 15 Mar 2021 17:14:56 +0000 Subject: [PATCH] Removing un-used code and removing some files from coverage that aren't of consequence. --- packages/server/package.json | 4 +++- .../server/src/utilities/createAppPackage.js | 2 ++ packages/server/src/utilities/exceptions.js | 16 ---------------- 3 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 packages/server/src/utilities/exceptions.js diff --git a/packages/server/package.json b/packages/server/package.json index a025d274f1..9c21fa4918 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -60,7 +60,9 @@ "!src/utilities/usageQuota.js", "!src/api/routes/tests/**/*", "!src/tests/**/*", - "!src/automations/tests/**/*" + "!src/automations/tests/**/*", + "!src/utilities/fileProcessor.js", + "!src/utilities/initialiseBudibase.js" ], "coverageReporters": [ "lcov", diff --git a/packages/server/src/utilities/createAppPackage.js b/packages/server/src/utilities/createAppPackage.js index a62e8c96df..9500554227 100644 --- a/packages/server/src/utilities/createAppPackage.js +++ b/packages/server/src/utilities/createAppPackage.js @@ -7,6 +7,8 @@ const packageJson = require("../../package.json") const streamPipeline = promisify(stream.pipeline) +// can't really test this due to the downloading nature of it, wouldn't be a great test case +/* istanbul ignore next */ exports.downloadExtractComponentLibraries = async appFolder => { const LIBRARIES = ["standard-components"] diff --git a/packages/server/src/utilities/exceptions.js b/packages/server/src/utilities/exceptions.js deleted file mode 100644 index e02c88eec3..0000000000 --- a/packages/server/src/utilities/exceptions.js +++ /dev/null @@ -1,16 +0,0 @@ -const statusCodes = require("./statusCodes") - -const errorWithStatus = (message, statusCode) => { - const e = new Error(message) - e.statusCode = statusCode - return e -} - -module.exports.unauthorized = message => - errorWithStatus(message, statusCodes.UNAUTHORIZED) - -module.exports.forbidden = message => - errorWithStatus(message, statusCodes.FORBIDDEN) - -module.exports.notfound = message => - errorWithStatus(message, statusCodes.NOT_FOUND)