-
Notifications
You must be signed in to change notification settings - Fork 0
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
test: check pkglock is updated correctly #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests, that side of the behaviour is definitely important, especially now that that's the biggest problem it solves. Here's some feedback (first time using the review tool!).
@@ -89,6 +105,47 @@ test('development dependency identification', function (t) { | |||
t.is(code, 0, 'no error code') | |||
t.is(stderr, '', 'no error output') | |||
t.notOk(fs.existsSync(path.join(devDir, 'node_modules')), 'did not install anything') | |||
t.similar(JSON.parse(fs.readFileSync(path.join(optionalDir, 'package-lock.json'), 'utf8')), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be devDir
right?
dependencies: { | ||
a: { | ||
version: 'file:../a-1.0.0.tgz', | ||
optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And these ones changed accordingly to dev: true
.
optional: true, | ||
} | ||
} | ||
}, 'locks dependencies as optional') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then this should be dev
too.
@larsgw nice one, thanks for the feedback! Pushed the fixes 👌 |
@larsgw awesome work on this fix! I've been trying to understand what it's doing and added a few tests to check the lockfile was updated correctly.
Let me know if this makes sense and is helpful!
Also fyi, pushed a fix for the failing spec in the
release-next
branch: npm#88