Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Failing unit tests present in master on Windows #92

Closed
ghost opened this issue Oct 25, 2018 · 5 comments
Closed

Failing unit tests present in master on Windows #92

ghost opened this issue Oct 25, 2018 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Oct 25, 2018

I ran npm run test:unit today in one of my branches and found that these tests were failing for me on windows:

FAIL  packages\imperative\__tests__\plugins\utilities\npm-interface\uninstall.test.ts
  ● Test suite failed to run

    TypeError: Cannot read property 'prototype' of undefined

      at patch (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:166:54)
      at Object.<anonymous> (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:27:18)
      at node_modules/npm/lib/npm.js:19:13
      at Object.<anonymous> (node_modules/npm/lib/npm.js:490:3)

 FAIL  packages\imperative\__tests__\plugins\utilities\npm-interface\update.test.ts
  ● Test suite failed to run

    TypeError: Cannot read property 'prototype' of undefined

      at patch (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:166:54)
      at Object.<anonymous> (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:27:18)
      at node_modules/npm/lib/npm.js:19:13
      at Object.<anonymous> (node_modules/npm/lib/npm.js:490:3)

 FAIL  packages\imperative\__tests__\plugins\utilities\npm-interface\install.test.ts
  ● Test suite failed to run

    TypeError: Cannot read property 'prototype' of undefined

      at patch (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:166:54)
      at Object.<anonymous> (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:27:18)
      at node_modules/npm/lib/npm.js:19:13
      at Object.<anonymous> (node_modules/npm/lib/npm.js:490:3)

Summary of all failing tests
 FAIL  packages\imperative\__tests__\plugins\utilities\npm-interface\uninstall.test.ts
  ● Test suite failed to run

    TypeError: Cannot read property 'prototype' of undefined

      at patch (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:166:54)
      at Object.<anonymous> (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:27:18)
      at node_modules/npm/lib/npm.js:19:13
      at Object.<anonymous> (node_modules/npm/lib/npm.js:490:3)

 FAIL  packages\imperative\__tests__\plugins\utilities\npm-interface\update.test.ts
  ● Test suite failed to run

    TypeError: Cannot read property 'prototype' of undefined

      at patch (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:166:54)
      at Object.<anonymous> (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:27:18)
      at node_modules/npm/lib/npm.js:19:13
      at Object.<anonymous> (node_modules/npm/lib/npm.js:490:3)

 FAIL  packages\imperative\__tests__\plugins\utilities\npm-interface\install.test.ts
  ● Test suite failed to run

    TypeError: Cannot read property 'prototype' of undefined

      at patch (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:166:54)
      at Object.<anonymous> (node_modules/npm/node_modules/graceful-fs/graceful-fs.js:27:18)
      at node_modules/npm/lib/npm.js:19:13
      at Object.<anonymous> (node_modules/npm/lib/npm.js:490:3)


Test Suites: 3 failed, 74 passed, 77 total

So I switched to master to confirm if it was me and I unfortunately saw the same errors. Looking at the error it looks to have been introduced by #75. @nurra01 could you take a look at this and get a fix to master ASAP?

Interesting that you do no see this behavior on the build machine, that's why I didn't catch it. I just made the assumption that you were developing on a windows machine so you would be running a sanity check on windows, I should have run the tests as well on my machine...my bad 🙁

@ghost ghost added the bug Something isn't working label Oct 25, 2018
@ghost ghost added this to the CA - 18PI4S4 milestone Oct 25, 2018
@ghost
Copy link
Author

ghost commented Oct 25, 2018

So I've updated my node from 10.6.0 to 10.9.0 and the issue seems to have gone away.

@nurra01 are these messages expected in the output of the tests?

info error reading version SyntaxError: Unexpected token u in JSON at position 0 while parsing near 'undefined'

If these are expected then I am fine with closing this issue as it seems to be related to a node version.

@nurra01
Copy link
Contributor

nurra01 commented Oct 26, 2018

@AHumanFromCA These messages are coming from NPM's side, it tries to find package.json file and parse it. You can find it in node_modules/npm/lib/npm.js line 83. I cannot get rid of that like NPM warning which we have.
var j = parseJSON(fs.readFileSync(
path.join(__dirname, '../package.json')) + '')

@ghost
Copy link
Author

ghost commented Oct 26, 2018

Hey @nurra01,

So are you saying that these messages are expected and the tests are still operating as expected?

@nurra01
Copy link
Contributor

nurra01 commented Oct 26, 2018

@AHumanFromCA yes

@ghost
Copy link
Author

ghost commented Oct 26, 2018

Updating node from 10.6 to 10.9 fixed the issue, closing.

@ghost ghost closed this as completed Oct 26, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant