mainmatter / compare-fixture

1 stars 0 forks source link

When a file is present in one of the folders but not present on the other, it triggers an Error #5

Open oscard0m opened 1 year ago

oscard0m commented 1 year ago

Example: types.js is present in one folder but not on the other.

ls ../octokit/webhooks.js/pkg-pika/dist-src ../octokit/webhooks.js/pkg/dist-src --no-user

image

Error Output

Error: ENOENT: no such file or directory, open '../octokit/webhooks.js/pkg/dist-src/middleware/node/types.js'
    at Object.openSync (node:fs:590:3)
    at readFileSync (node:fs:458:35)
    at file:///Users/XXX/dev/open_source/compare-fixture/index.js:21:25
    at Array.forEach (<anonymous>)
    at compareFixture (file:///Users/XXX/dev/open_source/compare-fixture/index.js:20:16)
    at file:///Users/XXXX/dev/open_source/compare-fixture/cli.js:7:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '../octokit/webhooks.js/pkg/dist-src/middleware/node/types.js'
}
oscard0m commented 1 year ago

I'm happy to collaborate with a PR.

mansona commented 9 months ago

Sorry I only saw this issue now 🙈 If I remember correctly this is intended to be used with sparse fixtures and fuller output folders, so it matters which folder you put in which order 🤔 Did you try to swap them around?

oscard0m commented 9 months ago

Sorry I only saw this issue now 🙈 If I remember correctly this is intended to be used with sparse fixtures and fuller output folders, so it matters which folder you put in which order 🤔 Did you try to swap them around?

I don't remember if I tried it. When I find time to try it, I will come back to you. Thanks!

mansona commented 9 months ago

I think it's something that we can still fix, rather than just throwing an error we could check if the file exists first and complain about it missing. And maybe even warn about the fact that the order matters if it comes across this case. What do you think?

oscard0m commented 9 months ago

I think it's something that we can still fix, rather than just throwing an error we could check if the file exists first and complain about it missing. And maybe even warn about the fact that the order matters if it comes across this case. What do you think?

I completely agree. A more detailed hint on what am I doing wrong as a user would be perfect.