nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
20 lines (14 loc) • 417 B
JavaScript
module.exports.create = function createScopedValue(value, nightwatchInstance) {
class ScopedValue {
constructor(value) {
this.value = Promise.resolve(value);
}
then(onFulfilled, onRejected) {
return this.value.then(onFulfilled, onRejected);
}
map(callback) {
return createScopedValue(this.then(callback), nightwatchInstance);
}
}
return new ScopedValue(value);
};