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

@betterer/betterer AssertionError getting result file #1135

Open
ramykl opened this issue May 4, 2023 · 1 comment
Open

@betterer/betterer AssertionError getting result file #1135

ramykl opened this issue May 4, 2023 · 1 comment

Comments

@ramykl
Copy link

ramykl commented May 4, 2023

Describe the bug
@betterer/better doesn't seem to be able to find the results file.

AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  (0, assert_1.default)(hasResult)

    at BettererResultsFileΩ._getResult (/Users/ramy.loveridge/Products/betterer-test/node_modules/@betterer/betterer/src/results/results-file.ts:96:11)
    at BettererResultsFileΩ.getExpected (/Users/ramy.loveridge/Products/betterer-test/node_modules/@betterer/betterer/src/results/results-file.ts:44:27)
    at /Users/ramy.loveridge/Products/betterer-test/node_modules/@betterer/betterer/src/results/results-summary.ts:47:44
    at async Promise.all (index 0)
    at async Function.create (/Users/ramy.loveridge/Products/betterer-test/node_modules/@betterer/betterer/src/results/results-summary.ts:43:26)
    at async main (/Users/ramy.loveridge/Products/betterer-test/bettererStats.ts:9:19) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}

To Reproduce
minimal repo https://github.com/ramykl/betterer-test
run yarn reportCi
This is to output the results in a readable format but it can't seem to get the result file.

Expected behavior
Able to get the results from the result file programmatically as per the docs.

Versions (please complete the following information):

  • OS: MacOS
  • Betterer Version : 5.4.0
  • Node Version: 18.15.0

Additional context
Add any other context about the problem here.

@ramykl ramykl changed the title @betterer/better AssertionError getting result file @betterer/betterer AssertionError getting result file May 6, 2023
@ramykl
Copy link
Author

ramykl commented May 8, 2023

this issue comes whenever you have a test that succeeds, ie. no issues found. It is thrown because of this returns an error

const hasResult = Object.hasOwnProperty.call(results, name);
assert(hasResult);

Not sure what the best fix is, to wrap it in a try/catch or if there are no issues should the test be removed? Either way at least a better error here would be great

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

No branches or pull requests

1 participant