From 08349e5cf8d9b8e44c70179df78200e72f6f2ffa Mon Sep 17 00:00:00 2001 From: Matheus Lichtnow Date: Mon, 20 Jan 2020 17:59:32 -0800 Subject: [PATCH] test(handler): removed useless tests --- src/__tests__/rules/rule-handlers.spec.ts | 20 -------------------- src/rules/rule-handlers.ts | 5 +++-- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 src/__tests__/rules/rule-handlers.spec.ts diff --git a/src/__tests__/rules/rule-handlers.spec.ts b/src/__tests__/rules/rule-handlers.spec.ts deleted file mode 100644 index aed663b..0000000 --- a/src/__tests__/rules/rule-handlers.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -import path from 'path'; -import { Handlers } from '../../rules/rule-handlers'; -import { parse } from '../../index'; - -/** - * This test will be removed later when the handlers are actually implemented - * it was added to reach 100% coverage for now - * @todo remove this test after handler tests are all implemented - */ -describe('Handlers object', () => { - const apiFile = path.join(__dirname, '..', 'data', 'correct', 'swagger.yml'); - - it('should import all handlers correctly', async () => { - const api = await parse(apiFile); - - Object.values(Handlers).forEach(handler => { - handler(api, []); - }); - }); -}); diff --git a/src/rules/rule-handlers.ts b/src/rules/rule-handlers.ts index b5aa15e..db26b08 100644 --- a/src/rules/rule-handlers.ts +++ b/src/rules/rule-handlers.ts @@ -5,7 +5,8 @@ import { mustContainServerURL, mustContainPort, noSingularResource, - mustContainVersion + mustContainVersion, + mustContainDomainAndContext } from './handlers'; /** @@ -19,7 +20,7 @@ export type RuleHandlers = { * Object containing all the rule handlers */ export const Handlers: RuleHandlers = { - "must-contain-domain-and-context": (api, ruleFaults) => { return; }, + "must-contain-domain-and-context": mustContainDomainAndContext, "must-contain-server-url": mustContainServerURL, "must-contain-port": mustContainPort, "must-contain-version": mustContainVersion,