Open
Conversation
… instead of listening to text message
osher
requested changes
Jul 9, 2020
| { | ||
| "name": "e2e-helper", | ||
| "version": "0.9.4", | ||
| "version": "0.10.0", |
Owner
There was a problem hiding this comment.
its fully compatible with prev versions.
Since this version starts with 0, by semver rules the minor is acting like a major and (~ and ^ behave the same)
leave version bumping to me
| , " - timeout - integer, optional - timeout for server setup, default: " + defaults.timeout | ||
| , " - slow - integer, optional - slow bar indicator for server setup, default: " + defaults.timeout | ||
| , " - readyNotice - string, optional - message to expect on service output that" | ||
| , " - readyNotice - string or function, optional - message to expect on service output that" |
Owner
There was a problem hiding this comment.
replace lines 187 and 188 with:
, " - readyNotice - optional string or a function,"
, " - string: message to expect on service output that indicates the service is ready."
, " - function: is passed the usual err-1st callback to call when the service is ready, or to pass an error when such error occurs."
, " may also return a Promise instread"
, " default: the string '" + defaults.readyNotice + "'"
| check that the service is up | ||
| @param {mocha.Test} test - the test context that implements .timetout(n), .slow(n) .... | ||
| @param {callback} done - callback | ||
| @param {function} done - callback |
Owner
There was a problem hiding this comment.
not any function. an err-1st callback - hence callback.
| } | ||
| }) | ||
| } | ||
|
|
Owner
There was a problem hiding this comment.
if ('string' == typeof ctx.readyNotice) {
const readyNotice = ctx.readyNotice
ctx.readyNotice = () => new Promise(done => child.stdout.on('data', (data) => ~data.indexOf(readyNotice) && done()))
}
var promise = ctx.readyNotice((err) => {
if (!done) return
if (!err) ctx.console.log('service started: %s', ctx.args.join(' '))
done(err)
done = null
})
promise && promise.then && promise.catch((err) => err || new Error('ready hook rejection')).then((err) => {
done(err instasnceof Error ? err : null)
done = null
})
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support passing a method as a readyNotice that will be called instead of listening to text message