Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new standard rules #58

Merged
merged 1 commit into from
Jul 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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": {
Expand Down
20 changes: 10 additions & 10 deletions test/fastify-env.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const tests = [
name: 'simple object - ok - required + default',
schema: {
type: 'object',
required: [ 'PORT' ],
required: ['PORT'],
properties: {
PORT: {
type: 'integer',
Expand All @@ -122,7 +122,7 @@ const tests = [
name: 'simple object - ok - allow array',
schema: {
type: 'object',
required: [ 'PORT' ],
required: ['PORT'],
properties: {
PORT: {
type: 'integer',
Expand All @@ -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',
Expand All @@ -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,
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -218,7 +218,7 @@ const tests = [
name: 'simple object - KO',
schema: {
type: 'object',
required: [ 'PORT' ],
required: ['PORT'],
properties: {
PORT: {
type: 'integer'
Expand All @@ -233,7 +233,7 @@ const tests = [
name: 'simple object - invalid data',
schema: {
type: 'object',
required: [ 'PORT' ],
required: ['PORT'],
properties: {
PORT: {
type: 'integer'
Expand Down Expand Up @@ -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',
Expand Down