From 3031d187afd363ae343d01173180e9d9b405c103 Mon Sep 17 00:00:00 2001 From: Manuel Spigolon Date: Sat, 13 Jul 2019 12:15:25 +0200 Subject: [PATCH] new standard rules --- package.json | 3 ++- test/fastify-env.test.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 17f25c3..72b2c9e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "lint": "standard | snazzy", + "lint:fix": "standard --fix", "unit": "cross-env VALUE_FROM_ENV=pippo tap test", "test": "npm run lint && npm run unit", "coverage": "cross-env VALUE_FROM_ENV=pippo tap --cov --coverage-report=html test" @@ -31,7 +32,7 @@ "fastify": "^2.0.0", "pre-commit": "^1.2.2", "snazzy": "^8.0.0", - "standard": "^12.0.0", + "standard": "^13.0.1", "tap": "^12.6.6" }, "greenkeeper": { diff --git a/test/fastify-env.test.js b/test/fastify-env.test.js index 45644e3..e2d151f 100644 --- a/test/fastify-env.test.js +++ b/test/fastify-env.test.js @@ -104,7 +104,7 @@ const tests = [ name: 'simple object - ok - required + default', schema: { type: 'object', - required: [ 'PORT' ], + required: ['PORT'], properties: { PORT: { type: 'integer', @@ -122,7 +122,7 @@ const tests = [ name: 'simple object - ok - allow array', schema: { type: 'object', - required: [ 'PORT' ], + required: ['PORT'], properties: { PORT: { type: 'integer', @@ -140,7 +140,7 @@ const tests = [ name: 'simple object - ok - merge multiple object + env', schema: { type: 'object', - required: [ 'PORT', 'MONGODB_URL' ], + required: ['PORT', 'MONGODB_URL'], properties: { PORT: { type: 'integer', @@ -154,7 +154,7 @@ const tests = [ } } }, - data: [ { PORT: 3333 }, { MONGODB_URL: 'mongodb://localhost/pippo' } ], + data: [{ PORT: 3333 }, { MONGODB_URL: 'mongodb://localhost/pippo' }], isOk: true, confExpected: { PORT: 3333, @@ -166,7 +166,7 @@ const tests = [ name: 'simple object - ok - load only from env', schema: { type: 'object', - required: [ 'VALUE_FROM_ENV' ], + required: ['VALUE_FROM_ENV'], properties: { VALUE_FROM_ENV: { type: 'string' @@ -183,7 +183,7 @@ const tests = [ name: 'simple object - ok - opts override environment', schema: { type: 'object', - required: [ 'VALUE_FROM_ENV' ], + required: ['VALUE_FROM_ENV'], properties: { VALUE_FROM_ENV: { type: 'string' @@ -200,7 +200,7 @@ const tests = [ name: 'simple object - ok - load only from .env', schema: { type: 'object', - required: [ 'VALUE_FROM_DOTENV' ], + required: ['VALUE_FROM_DOTENV'], properties: { VALUE_FROM_DOTENV: { type: 'string' @@ -218,7 +218,7 @@ const tests = [ name: 'simple object - KO', schema: { type: 'object', - required: [ 'PORT' ], + required: ['PORT'], properties: { PORT: { type: 'integer' @@ -233,7 +233,7 @@ const tests = [ name: 'simple object - invalid data', schema: { type: 'object', - required: [ 'PORT' ], + required: ['PORT'], properties: { PORT: { type: 'integer' @@ -263,7 +263,7 @@ t.test('should use custom config key name', t => { t.plan(1) const schema = { type: 'object', - required: [ 'PORT' ], + required: ['PORT'], properties: { PORT: { type: 'integer',