mirror of
https://github.com/nix-community/home-manager
synced 2024-12-20 00:39:47 +01:00
vscode: add userTasks test
This commit is contained in:
parent
39c1e6704a
commit
9333581075
2 changed files with 44 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
vscode-keybindings = ./keybindings.nix;
|
||||
vscode-tasks = ./tasks.nix;
|
||||
vscode-update-checks = ./update-checks.nix;
|
||||
}
|
||||
|
|
43
tests/modules/programs/vscode/tasks.nix
Normal file
43
tests/modules/programs/vscode/tasks.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
|
||||
tasksFilePath = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
"Library/Application Support/Code/User/tasks.json"
|
||||
else
|
||||
".config/Code/User/tasks.json";
|
||||
|
||||
tasks = {
|
||||
version = "2.0.0";
|
||||
tasks = [{
|
||||
type = "shell";
|
||||
label = "Hello task";
|
||||
command = "hello";
|
||||
}];
|
||||
};
|
||||
|
||||
expectedTasks = pkgs.writeText "tasks-expected.json" ''
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"command": "hello",
|
||||
"label": "Hello task",
|
||||
"type": "shell"
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
'';
|
||||
|
||||
in {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.writeScriptBin "vscode" "" // { pname = "vscode"; };
|
||||
userTasks = tasks;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists "home-files/${tasksFilePath}"
|
||||
assertFileContent "home-files/${tasksFilePath}" "${expectedTasks}"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue