Fail js tests if dirty package-lock
This commit is contained in:
@@ -303,7 +303,10 @@ def run_complexity():
|
||||
|
||||
|
||||
@task
|
||||
@needs('pavelib.prereqs.install_node_prereqs')
|
||||
@needs(
|
||||
'pavelib.prereqs.install_node_prereqs',
|
||||
'pavelib.utils.test.utils.ensure_clean_package_lock',
|
||||
)
|
||||
@cmdopts([
|
||||
("limit=", "l", "limit for number of acceptable violations"),
|
||||
])
|
||||
|
||||
@@ -33,6 +33,18 @@ def clean_test_files():
|
||||
sh("rm -rf /tmp/mako_[cl]ms")
|
||||
|
||||
|
||||
@task
|
||||
@timed
|
||||
def ensure_clean_package_lock():
|
||||
"""
|
||||
Ensure no untracked changes have been made in the current git context.
|
||||
"""
|
||||
sh("""
|
||||
git diff --name-only --exit-code package-lock.json ||
|
||||
(echo \"Dirty package-lock.json, run 'npm install' and commit the generated changes\" && exit 1)
|
||||
""")
|
||||
|
||||
|
||||
def clean_dir(directory):
|
||||
"""
|
||||
Delete all the files from the specified directory.
|
||||
|
||||
Reference in New Issue
Block a user