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

bug: no OutOfSyncError on github revision mismatch #123

Closed
milahu opened this issue Sep 27, 2021 · 0 comments
Closed

bug: no OutOfSyncError on github revision mismatch #123

milahu opened this issue Sep 27, 2021 · 0 comments
Labels

Comments

@milahu
Copy link

milahu commented Sep 27, 2021

reproduce

cd $(mktemp -d)
npm init -y
npm i snyk-nodejs-lockfile-parser
npm i "github:milahu/postcss-nodegui-autoprefixer#e180d6a5f2f313d634f73637a285c129de90d530"

sed -i 's/e180d6a5f2f313d634f73637a285c129de90d530/f4311b3ce656395d469e9a7df0b940bdc184a757/' package.json
# now package.json and package-lock.json are out of sync

src="const read = path => require('fs').readFileSync(path, 'utf8');"
src+="async function main() { console.dir(await require('snyk-nodejs-lockfile-parser')."
# call buildDepTree
# last argument: strictOutOfSync = true
src+="buildDepTree(read('package.json'), read('package-lock.json'), true, 'npm', true)"
src+="); }; main()"
node -e "$src"

expected result: should throw OutOfSyncError

actual result

{
  dependencies: {
    'postcss-nodegui-autoprefixer': {
      labels: [Object],
      name: 'postcss-nodegui-autoprefixer',
      version: 'git+ssh://git@github.com/milahu/postcss-nodegui-autoprefixer.git#e180d6a5f2f313d634f73637a285c129de90d530',
      dependencies: [Object]
    },
    'snyk-nodejs-lockfile-parser': {
      labels: [Object],
      name: 'snyk-nodejs-lockfile-parser',
      version: '1.37.0',
      dependencies: [Object]
    }
  },
  hasDevDependencies: false,
  name: 'tmp.ibogyemwlr',
  size: 300,
  version: '1.0.0',
  meta: { lockfileVersion: 2, packageManager: 'npm' }
}
@github-actions github-actions bot added the Stale label May 15, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant