Skip to content

Commit

Permalink
Add failing test for af#74
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Feb 20, 2018
1 parent 8299e3a commit beb5c3a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"eslint": "4.5.0",
"eslint-plugin-prettier": "2.2.0",
"husky": "0.14.3",
"is-promise": "2.1.0",
"lint-staged": "4.0.4",
"nyc": "11.1.0",
"painless": "0.9.5",
Expand Down
13 changes: 13 additions & 0 deletions tests/test_strict.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs')
const { createGroup, assert } = require('painless')
const isPromise = require('is-promise')
const { cleanEnv, str, num } = require('..')
const test = createGroup()
const strictOption = { strict: true }
Expand Down Expand Up @@ -121,3 +122,15 @@ test('strict mode env object not error out on .length checks (#70)', () => {

assert.doesNotThrow(() => env.length)
})

test('strict mode allows is-promise check without throwing', () => {
const env = cleanEnv(
{ FOO: 'foo' },
{
FOO: str()
},
strictOption
)

assert.doesNotThrow(() => isPromise(env))
})

0 comments on commit beb5c3a

Please sign in to comment.