nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
17 lines (16 loc) • 537 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
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);
};