From e07dbb9103a65e0cab5b35ebb6588db97fc862a4 Mon Sep 17 00:00:00 2001 From: scott-wyatt Date: Sun, 7 Oct 2018 11:36:01 -0400 Subject: [PATCH] [chore] archetype, increase coverage --- .../config/tapestries.ts | 2 +- package-lock.json | 22 +++++++++---------- package.json | 13 ++++++----- test/unit/lib/errors.test.js | 6 +++++ test/unit/lib/validateConfig.test.js | 19 ++++++++++++++++ 5 files changed, 44 insertions(+), 18 deletions(-) rename {lib/archetype => archetype}/config/tapestries.ts (95%) create mode 100644 test/unit/lib/validateConfig.test.js diff --git a/lib/archetype/config/tapestries.ts b/archetype/config/tapestries.ts similarity index 95% rename from lib/archetype/config/tapestries.ts rename to archetype/config/tapestries.ts index 3d25ead..3aaa42c 100755 --- a/lib/archetype/config/tapestries.ts +++ b/archetype/config/tapestries.ts @@ -5,7 +5,7 @@ * Tapestries are routes that are auto-generated from your model and controller * definitions in api/controllers and api/models. * - * @see http://fabrix.app/doc/config/tapestries + * @see https://fabrix.app/docs/config/tapestries */ export const tapestries = { /** diff --git a/package-lock.json b/package-lock.json index 10f5abe..0aca298 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@fabrix/spool-tapestries", - "version": "1.5.0", + "version": "1.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -114,9 +114,9 @@ } }, "@fabrix/fabrix": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@fabrix/fabrix/-/fabrix-1.5.0.tgz", - "integrity": "sha512-/5tEjBnZ3GQ5FfOp+SOOuFJjw9UgsmgMnjXo1kI9EX7QOz1u1iErVdDBmWj/aunnz1x+Ta2KlLIGCeXARwOorA==", + "version": "1.5.9", + "resolved": "https://registry.npmjs.org/@fabrix/fabrix/-/fabrix-1.5.9.tgz", + "integrity": "sha512-28g+rUUngvsNctrUd2e0bIOrZ2Mx5HIfUy3/3P6BYjdaE/YqhpsnBiSWYmnfv/rN6LAJSjronioaklwP54h+jw==", "dev": true, "requires": { "lodash": "4.17.11", @@ -138,13 +138,13 @@ "dev": true }, "@fabrix/spool-router": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@fabrix/spool-router/-/spool-router-1.5.0.tgz", - "integrity": "sha512-94Kd709GNykjWmpKzlZ2RkKjJGaYpub/LcRYA/D5QW9TBx2eUDSq9sAbSWwZ4dQrBg7QBe3TEpoPGgff6WvC2g==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@fabrix/spool-router/-/spool-router-1.5.1.tgz", + "integrity": "sha512-ihR3fjuJGo+jJTbz7xEuFQ96DviI8kOmqaVMYLjS6MJpjIMDbHMNneff6OrHixWy0sx7T5gpuudj7X5FLhrKBg==", "dev": true, "requires": { "call": "5.0.1", - "joi": "13.6.0", + "joi": "13.7.0", "lodash": "4.17.11" }, "dependencies": { @@ -463,9 +463,9 @@ } }, "joi": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-13.6.0.tgz", - "integrity": "sha512-E4QB0yRgEa6ZZKcSHJuBC+QeAwy+akCG0Bsa9edLqljyhlr+GuGDSmXYW1q7sj/FuAPy+ECUI3evVtK52tVfwg==", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz", + "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==", "dev": true, "requires": { "hoek": "5.0.4", diff --git a/package.json b/package.json index 76762b6..55c61b8 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fabrix/spool-tapestries", - "version": "1.5.0", + "version": "1.5.1", "description": "Spool - Tapestries, Easy RESTful Services", "scripts": { "build": "tsc -p ./lib/tsconfig.release.json", @@ -14,7 +14,8 @@ "main": "dist/index.js", "typings": "dist/index.d.ts", "files": [ - "dist" + "dist", + "archetype" ], "pre-commit": [ "test" @@ -49,8 +50,8 @@ "lodash": "^4.17.10" }, "devDependencies": { - "@fabrix/fabrix": "^1.5.0", - "@fabrix/spool-router": "^1.5.0", + "@fabrix/fabrix": "^1.5.9", + "@fabrix/spool-router": "^1.5.1", "@fabrix/lint": "^1.0.0-alpha.3", "@types/lodash": "^4.14.109", "@types/node": "~10.3.4", @@ -64,8 +65,8 @@ "typescript": "~2.8.1" }, "peerDependencies": { - "@fabrix/fabrix": "^1.5.0", - "@fabrix/spool-router": "^1.5.0" + "@fabrix/fabrix": "^1.5.9", + "@fabrix/spool-router": "^1.5.1" }, "license": "MIT", "bugs": { diff --git a/test/unit/lib/errors.test.js b/test/unit/lib/errors.test.js index af1313b..636f777 100644 --- a/test/unit/lib/errors.test.js +++ b/test/unit/lib/errors.test.js @@ -9,4 +9,10 @@ describe('lib.Errors', () => { assert.equal(err.name, 'TapestryServiceNotInstalledError') }) }) + describe('TapestryControllerNotInstalledError', () => { + it('#name', () => { + const err = new lib.Errors.TapestryControllerNotInstalledError() + assert.equal(err.name, 'TapestryControllerNotInstalledError') + }) + }) }) diff --git a/test/unit/lib/validateConfig.test.js b/test/unit/lib/validateConfig.test.js new file mode 100644 index 0000000..e249668 --- /dev/null +++ b/test/unit/lib/validateConfig.test.js @@ -0,0 +1,19 @@ +'use strict' + +//const _ = require('lodash') +const assert = require('assert') +const lib = require('../../../dist/validator/validateConfig') + +describe('lib.ValidateConfig', () => { + describe('#validateConfig', () => { + it('should validate a bad tapestries config', (done) => { + lib.validateConfig.validateConfig('break') + .then(broke => { + done(broke) + }) + .catch(err => { + done() + }) + }) + }) +})