def METHOD_NAME(
    config: BaseConfig,
    chdir: Path,
    pkg_lock_content: str,
    pkg_lock_expected: str,
    pkg_shrinkwrap_content: str,
    pkg_shrinkwrap_expected: str,
):
    pkg = chdir / "package.json"
    pkg.write_text(dedent(NPM_PACKAGE_JSON))
    if pkg_lock_content:
        pkg_lock = chdir / "package-lock.json"
        pkg_lock.write_text(dedent(pkg_lock_content))
    if pkg_shrinkwrap_content:
        pkg_shrinkwrap = chdir / "npm-shrinkwrap.json"
        pkg_shrinkwrap.write_text(dedent(pkg_shrinkwrap_content))
    config.settings["version_provider"] = "npm"
    provider = get_provider(config)
    assert isinstance(provider, NpmProvider)
    assert provider.get_version() == "0.1.0"
    provider.set_version("42.1")
    assert pkg.read_text() == dedent(NPM_PACKAGE_EXPECTED)
    if pkg_lock_content:
        assert pkg_lock.read_text() == dedent(pkg_lock_expected)
    if pkg_shrinkwrap_content:
        assert pkg_shrinkwrap.read_text() == dedent(pkg_shrinkwrap_expected)