Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Test Results #8

Open
CodeLenny opened this issue Jun 28, 2017 · 1 comment
Open

Provide Test Results #8

CodeLenny opened this issue Jun 28, 2017 · 1 comment

Comments

@CodeLenny
Copy link
Contributor

CodeLenny commented Jun 28, 2017

Have each individual test publish the results of the run:

  • success/failure
  • run duration
  • if failure, provide number of shrinks, counter-example, etc. See what JSVerify provides to shrinkResult

Store results in an array of TestResult objects:

class FailedTestError extends CustomError {
  constructor(res) {
    this.result = res;
  }
  get message() {
    return `shrunk ${this.result.shrinks} times, ...`;
  }
}

class TestResult {
  constructor() {
    this._work = Promise.defer();
  }
  success() {
    this.successful = true;
    this._work.resolve();
  }
  failure(shrinks, counterExample, ...) {
    this.successful = false;
    this.shrinks = shrinks;
    // ...
    this._work.reject(new FailedTestError(this));
  }
  get then() {
    return this._work.promise.then;
  }
  get catch() {
    return this._work.promise.catch;
  }
}
@CodeLenny
Copy link
Contributor Author

TestDetails is being implemented in #1, and will probably include most of the needed properties for TestResult as drafted in the description.

Waiting for #1 before starting to prevent duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant