Unverified Commit afa3f9b7 authored by Pierre Bourdon's avatar Pierre Bourdon Committed by GitHub
Browse files

Merge pull request #264966 from l0b0/test/verify-npmrc-setup

nixos: test `programs.npm.npmrc` setting
parents 5fcb8660 cf8a4723
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -606,6 +606,7 @@ in {
  noto-fonts = handleTest ./noto-fonts.nix {};
  noto-fonts-cjk-qt-default-weight = handleTest ./noto-fonts-cjk-qt-default-weight.nix {};
  novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
  npmrc = handleTest ./npmrc.nix {};
  nscd = handleTest ./nscd.nix {};
  nsd = handleTest ./nsd.nix {};
  ntfy-sh = handleTest ./ntfy-sh.nix {};

nixos/tests/npmrc.nix

0 → 100644
+22 −0
Original line number Diff line number Diff line
import ./make-test-python.nix ({ ... }:
let
  machineName = "machine";
  settingName = "prefix";
  settingValue = "/some/path";
in
{
  name = "npmrc";

  nodes."${machineName}".programs.npm = {
    enable = true;
    npmrc = ''
      ${settingName} = ${settingValue}
    '';
  };

  testScript = ''
    ${machineName}.start()

    assert ${machineName}.succeed("npm config get ${settingName}") == "${settingValue}\n"
  '';
})