From 934a0cc56b255f5ab85f6d4fb4a1368e99dfdb10 Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 1 Nov 2025 03:00:28 +0900 Subject: [PATCH] tests: add fetcher regression test --- flake.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/flake.nix b/flake.nix index be11a0f..07827cd 100644 --- a/flake.nix +++ b/flake.nix @@ -60,6 +60,31 @@ }) // { format = treefmt.config.build.check self; + fetcher-assert-npm = + let + # force download debian for consistent hash across systems + binaryTargetBySystem = { + x86_64-linux = "debian"; + aarch64-linux = "debian"; + x86_64-darwin = "debian"; + aarch64-darwin = "debian"; + }; + prisma-legacy = prisma-factory { + inherit pkgs binaryTargetBySystem; + hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; + }; + prisma-new = + lockName: lockFile: + prisma-factory { + inherit pkgs binaryTargetBySystem; + hash = "sha256-R9PG286KQTbzF0r/PPcShUkMiYam2prRh/JICjmhCZA="; + ${lockName} = lockFile; + }; + in + assert + (prisma-legacy.fromNpmLock ./npm/package-lock.json).env + == (prisma-new "npmLock" ./npm/package-lock.json).env; + pkgs.hello; }; packages.default = (prisma-factory {