Browse Source

Rename PublicApi to ExecutionContext

This matches the terminology used in the README.
master
Mark Wubben 8 years ago
committed by Sindre Sorhus
parent
commit
3aeb8b019e
  1. 12
      lib/test.js

12
lib/test.js

@ -30,7 +30,7 @@ Object.keys(assert).forEach(el => {
SkipApi.prototype[el] = skipFn;
});
class PublicApi {
class ExecutionContext {
constructor(test) {
this._test = test;
this.skip = new SkipApi(test);
@ -98,13 +98,13 @@ function onAssertionEvent(event) {
return ret;
}
Object.assign(PublicApi.prototype, enhanceAssert({
Object.assign(ExecutionContext.prototype, enhanceAssert({
assert,
onSuccess: onAssertionEvent,
onError: onAssertionEvent
}));
Object.defineProperty(PublicApi.prototype, 'context', {enumerable: true});
Object.defineProperty(ExecutionContext.prototype, 'context', {enumerable: true});
class Test {
constructor(title, fn, contextRef, report) {
@ -176,7 +176,7 @@ class Test {
let ret;
try {
ret = this.fn(this._publicApi());
ret = this.fn(this._createExecutionContext());
} catch (err) {
this.threwSync = true;
@ -355,8 +355,8 @@ class Test {
return this.promise().promise;
}
_publicApi() {
return new PublicApi(this);
_createExecutionContext() {
return new ExecutionContext(this);
}
}

Loading…
Cancel
Save