yarn: add module (#7526)
This commit is contained in:
parent
b4752b0eda
commit
e9c599e40c
5 changed files with 91 additions and 0 deletions
4
tests/modules/programs/yarn/default.nix
Normal file
4
tests/modules/programs/yarn/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
yarn = ./example-config.nix;
|
||||
yarn-empty-config = ./empty-config.nix;
|
||||
}
|
||||
12
tests/modules/programs/yarn/empty-config.nix
Normal file
12
tests/modules/programs/yarn/empty-config.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
programs.yarn = {
|
||||
settings = {
|
||||
httpProxy = "http://proxy.example.org:3128";
|
||||
httpsProxy = "http://proxy.example.org:3128";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.yarnrc.yml
|
||||
'';
|
||||
}
|
||||
20
tests/modules/programs/yarn/example-config.nix
Normal file
20
tests/modules/programs/yarn/example-config.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
programs.yarn = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
httpProxy = "http://proxy.example.org:3128";
|
||||
httpsProxy = "http://proxy.example.org:3128";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
configPath = "home-files/.yarnrc.yml";
|
||||
in
|
||||
''
|
||||
assertFileExists ${configPath}
|
||||
assertFileContent ${configPath} \
|
||||
${./example-config.yml}
|
||||
'';
|
||||
}
|
||||
2
tests/modules/programs/yarn/example-config.yml
Normal file
2
tests/modules/programs/yarn/example-config.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
httpProxy: http://proxy.example.org:3128
|
||||
httpsProxy: http://proxy.example.org:3128
|
||||
Loading…
Add table
Add a link
Reference in a new issue