Skip to content

Commit

Permalink
feat(dependency): called out that we want the latest husky version, s…
Browse files Browse the repository at this point in the history
…o that it gets upgraded

which is especially important when v4 is installed and we want to upgrade to v5
  • Loading branch information
travi committed Apr 18, 2021
1 parent a60f3c1 commit fd3e284
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/scaffolder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ suite('scaffolder', () => {

const {devDependencies, scripts} = await scaffold({projectRoot, packageManager});

assert.deepEqual(devDependencies, ['husky']);
assert.deepEqual(devDependencies, ['husky@latest']);
assert.equal(scripts.prepare, 'husky install');
assert.calledWith(hookCreator.default, {configDirectory, hookName: 'pre-commit', script: `${packageManager} test`});
assert.neverCalledWith(
Expand Down
2 changes: 1 addition & 1 deletion src/scaffolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export default async function ({projectRoot, packageManager}) {
await createHook({configDirectory, hookName: 'commit-msg', script: 'npx --no-install commitlint --edit $1'});
}

return {devDependencies: ['husky'], scripts: {prepare: 'husky install'}};
return {devDependencies: ['husky@latest'], scripts: {prepare: 'husky install'}};
}
4 changes: 2 additions & 2 deletions test/integration/features/step_definitions/config-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Given('husky config is in v5 format', async function () {
});

Then('husky is configured for {string}', async function (packageManager) {
assert.include(this.result.devDependencies, 'husky');
assert.include(this.result.scripts.prepare, 'husky install');
assert.include(this.result.devDependencies, 'husky@latest');
assert.equal(this.result.scripts.prepare, 'husky install');
await assertHookContainsScript('pre-commit', `${packageManager} test`);
});

0 comments on commit fd3e284

Please sign in to comment.