From 3fff750af55c4098129a71a89b8df9a955b21f9f Mon Sep 17 00:00:00 2001 From: Agustin Colchado Date: Tue, 5 Dec 2023 00:34:36 -0800 Subject: [PATCH] Renames the test files to *.spec.js to prep for jest (#69) --- test/integration/ModuleIntegration.spec.js | 24 +++++++++++++++++ test/integration/ModuleIntegration_Spec.js | 26 ------------------- ...ddlewareSpec.js => BaseMiddleware.spec.js} | 0 ...ewareSpec.js => DefaultMiddleware.spec.js} | 0 ...dlewareSpec.js => ErrorMiddleware.spec.js} | 0 ...ewareSpec.js => NoCacheMiddleware.spec.js} | 0 ...ewareSpec.js => PromiseMiddleware.spec.js} | 0 ...> WinstonRequestLoggingMiddleware.spec.js} | 0 ...ntrollerSpec.js => BaseController.spec.js} | 0 ...WebServerSpec.js => BaseWebServer.spec.js} | 0 ...Spec.js => ControllerRegistration.spec.js} | 0 11 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 test/integration/ModuleIntegration.spec.js delete mode 100644 test/integration/ModuleIntegration_Spec.js rename test/unit/middleware/{BaseMiddlewareSpec.js => BaseMiddleware.spec.js} (100%) rename test/unit/middleware/{DefaultMiddlewareSpec.js => DefaultMiddleware.spec.js} (100%) rename test/unit/middleware/{ErrorMiddlewareSpec.js => ErrorMiddleware.spec.js} (100%) rename test/unit/middleware/{NoCacheMiddlewareSpec.js => NoCacheMiddleware.spec.js} (100%) rename test/unit/middleware/{PromiseMiddlewareSpec.js => PromiseMiddleware.spec.js} (100%) rename test/unit/middleware/{WinstonRequestLoggingMiddlewareSpec.js => WinstonRequestLoggingMiddleware.spec.js} (100%) rename test/unit/webserver/{BaseControllerSpec.js => BaseController.spec.js} (100%) rename test/unit/webserver/{BaseWebServerSpec.js => BaseWebServer.spec.js} (100%) rename test/unit/webserver/{ControllerRegistrationSpec.js => ControllerRegistration.spec.js} (100%) diff --git a/test/integration/ModuleIntegration.spec.js b/test/integration/ModuleIntegration.spec.js new file mode 100644 index 0000000..a5ab30c --- /dev/null +++ b/test/integration/ModuleIntegration.spec.js @@ -0,0 +1,24 @@ +const spur = require('spur-ioc'); + +// NEED to use require vs import to test module export for backward compatability +const mainModule = require('../../'); + +describe('Integration', function () { + describe('Main Module Integration Tests', () => { + beforeEach(() => { + this.ioc = spur.create('test-spur-common'); + this.ioc.merge(mainModule()); + }); + + it('base module dependencies are injectable', () => { + return this.ioc.inject((express, expressDevice, methodOverride, cookieParser, bodyParser, expressWinston) => { + expect(express).to.exist; + expect(expressDevice).to.exist; + expect(methodOverride).to.exist; + expect(cookieParser).to.exist; + expect(bodyParser).to.exist; + expect(expressWinston).to.exist; + }); + }); + }); +}); diff --git a/test/integration/ModuleIntegration_Spec.js b/test/integration/ModuleIntegration_Spec.js deleted file mode 100644 index d4d3347..0000000 --- a/test/integration/ModuleIntegration_Spec.js +++ /dev/null @@ -1,26 +0,0 @@ -const spur = require('spur-ioc'); - -// NEED to use require vs import to test module export for backward compatability -const mainModule = require('../../'); - -describe('Integration', function () { - describe('Main Module Integration Tests', () => { - beforeEach(() => { - this.ioc = spur.create('test-spur-common'); - this.ioc.merge(mainModule()); - }); - - describe('base dependencies', () => { - it('base module dependencies are injectable', () => { - return this.ioc.inject((express, expressDevice, methodOverride, cookieParser, bodyParser, expressWinston) => { - expect(express).to.exist; - expect(expressDevice).to.exist; - expect(methodOverride).to.exist; - expect(cookieParser).to.exist; - expect(bodyParser).to.exist; - expect(expressWinston).to.exist; - }); - }); - }); - }); -}); diff --git a/test/unit/middleware/BaseMiddlewareSpec.js b/test/unit/middleware/BaseMiddleware.spec.js similarity index 100% rename from test/unit/middleware/BaseMiddlewareSpec.js rename to test/unit/middleware/BaseMiddleware.spec.js diff --git a/test/unit/middleware/DefaultMiddlewareSpec.js b/test/unit/middleware/DefaultMiddleware.spec.js similarity index 100% rename from test/unit/middleware/DefaultMiddlewareSpec.js rename to test/unit/middleware/DefaultMiddleware.spec.js diff --git a/test/unit/middleware/ErrorMiddlewareSpec.js b/test/unit/middleware/ErrorMiddleware.spec.js similarity index 100% rename from test/unit/middleware/ErrorMiddlewareSpec.js rename to test/unit/middleware/ErrorMiddleware.spec.js diff --git a/test/unit/middleware/NoCacheMiddlewareSpec.js b/test/unit/middleware/NoCacheMiddleware.spec.js similarity index 100% rename from test/unit/middleware/NoCacheMiddlewareSpec.js rename to test/unit/middleware/NoCacheMiddleware.spec.js diff --git a/test/unit/middleware/PromiseMiddlewareSpec.js b/test/unit/middleware/PromiseMiddleware.spec.js similarity index 100% rename from test/unit/middleware/PromiseMiddlewareSpec.js rename to test/unit/middleware/PromiseMiddleware.spec.js diff --git a/test/unit/middleware/WinstonRequestLoggingMiddlewareSpec.js b/test/unit/middleware/WinstonRequestLoggingMiddleware.spec.js similarity index 100% rename from test/unit/middleware/WinstonRequestLoggingMiddlewareSpec.js rename to test/unit/middleware/WinstonRequestLoggingMiddleware.spec.js diff --git a/test/unit/webserver/BaseControllerSpec.js b/test/unit/webserver/BaseController.spec.js similarity index 100% rename from test/unit/webserver/BaseControllerSpec.js rename to test/unit/webserver/BaseController.spec.js diff --git a/test/unit/webserver/BaseWebServerSpec.js b/test/unit/webserver/BaseWebServer.spec.js similarity index 100% rename from test/unit/webserver/BaseWebServerSpec.js rename to test/unit/webserver/BaseWebServer.spec.js diff --git a/test/unit/webserver/ControllerRegistrationSpec.js b/test/unit/webserver/ControllerRegistration.spec.js similarity index 100% rename from test/unit/webserver/ControllerRegistrationSpec.js rename to test/unit/webserver/ControllerRegistration.spec.js