Skip to content

Commit

Permalink
feat!(config): remove default value on window
Browse files Browse the repository at this point in the history
  • Loading branch information
metcoder95 committed Jan 10, 2023
1 parent a498529 commit 5e302bd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ Standard Options:
Stability window, the time in ms defining the window of time that
resource needs to have not changed (file size or availability) before
signalling success, default 750ms. If less than interval, it will be
reset to the value of interval. This is only used for files, other
resources are considered available on first detection.
signalling success.
-h, --help
Expand Down
4 changes: 1 addition & 3 deletions help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ Standard Options:

Stability window, the time in ms defining the window of time that
resource needs to have not changed (file size or availability) before
signalling success, default 750ms. If less than interval, it will be
reset to the value of interval. This is only used for files, other
resources are considered available on first detection.
signalling success.

-h, --help

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function waitOnImpl (opts) {
}

// window needs to be at least interval
if (waitOnOptions.window < waitOnOptions.interval) {
if (waitOnOptions.window != null && waitOnOptions.window < waitOnOptions.interval) {
waitOnOptions.window = waitOnOptions.interval
}

Expand Down
3 changes: 1 addition & 2 deletions lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ module.exports = {
},
window: {
type: 'integer',
minimum: 0,
default: 250
minimum: 0
},
proxy: {
type: 'object',
Expand Down
6 changes: 3 additions & 3 deletions test/http.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { test } = require('tap')

const waitOn = require('..')

test('Wait-On#HTTP', { only: true }, context => {
test('Wait-On#HTTP', context => {
context.plan(7)

context.test('Basic HTTP', async t => {
Expand Down Expand Up @@ -89,7 +89,7 @@ test('Wait-On#HTTP', { only: true }, context => {
}
})

t.plan(4)
t.plan(3)
t.teardown(server.close.bind(server))

const waiting = waitOn({
Expand All @@ -114,7 +114,7 @@ test('Wait-On#HTTP', { only: true }, context => {
const result = await waiting

t.equal(result, true)
t.equal(callbackCalled, 3)
t.equal(callbackCalled, 2)
}
)

Expand Down

0 comments on commit 5e302bd

Please sign in to comment.