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

False positive test result without error #270

Open
Eternal-Rise opened this issue Aug 11, 2022 · 0 comments
Open

False positive test result without error #270

Eternal-Rise opened this issue Aug 11, 2022 · 0 comments

Comments

@Eternal-Rise
Copy link

Test runnner just end the work. No errors, no warning, no success log.

metatests.test('Read deep non-table identifiers', async (test) => {
  const sheet = new Sheet();

  sheet.cells['item.price.usd'] = 100;
  sheet.cells['item.price.uah'] = 200;

  test.strictSame(sheet.values['item.price'], { usd: 100, uah: 200 }); // -> should fail, but it isn't
  test.strictSame(1, 0); // -> obviously should fail, but it isn't

  test.end();
});
> metacalc@0.0.2 test
> npm run lint && npm run types && metatests test/unit.js


> metacalc@0.0.2 lint
> eslint . && prettier -c "**/*.js" "**/*.json" "**/*.md" "**/.*rc" "**/*.ts"

Checking formatting...
All matched files use Prettier code style!

> [email protected] types
> tsc -p tsconfig.json

Node v16.16.0 (v8 9.4.146.24-node.21):

But test will fail, if we call test.end(); with a delay

setTimeout(test.end, 0)

(Suppose, that this is incorect way for metatests at all, but it shows an error)

/home/eternal/dev/opensource/metarhia/metacalc/lib/sheet.js:28
      const targetProp = `${prop}.${currentProp}`;
                                    ^

TypeError: Cannot convert a Symbol value to a string
    at Object.get (/home/eternal/dev/opensource/metarhia/metacalc/lib/sheet.js:28:37)
    at Proxy.toString (<anonymous>)
    at Object.isError [as identify] (/home/eternal/dev/opensource/metarhia/metacalc/node_modules/metatests/lib/utils.js:45:50)
    at /home/eternal/dev/opensource/metarhia/metacalc/node_modules/yaml/dist/Schema-88e323a7.js:396:42
    at Array.find (<anonymous>)
    at findTagObject (/home/eternal/dev/opensource/metarhia/metacalc/node_modules/yaml/dist/Schema-88e323a7.js:396:15)
    at createNode (/home/eternal/dev/opensource/metarhia/metacalc/node_modules/yaml/dist/Schema-88e323a7.js:409:16)
    at Schema.createNode (/home/eternal/dev/opensource/metarhia/metacalc/node_modules/yaml/dist/Schema-88e323a7.js:507:12)
    at stringify (/home/eternal/dev/opensource/metarhia/metacalc/node_modules/yaml/dist/Document-9b4560a1.js:190:19)
    at Document.toString (/home/eternal/dev/opensource/metarhia/metacalc/node_modules/yaml/dist/Document-9b4560a1.js:737:20)

Reproducing: https://github.com/Eternal-Rise/metacalc/blob/false-positive-without-error/test/unit.js

Most likely refers to #269, but here is no error by default, so created new issue

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