test: add integration test for #221

This commit is contained in:
Martin Toman 2022-08-11 13:02:52 -07:00
parent 7c4a5a505f
commit c8faa3e7d2
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,32 @@
{
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
};
outputs = {
self,
dream2nix,
}: (dream2nix.lib.makeFlakeOutputs {
systems = ["x86_64-linux"];
config.projectRoot = ./.;
source = ./.;
packageOverrides = {
test = {
"check-linked-bin-version" = {
postInstall = ''
npm run get-version
VERSION=$(cat VERSION)
echo "$VERSION"
if [ "$VERSION" = "2.8.0" ]; then
echo "correct version installed - direct dependency"
else
echo "wrong version installed - transitive dependency"
exit 1
fi
'';
};
};
};
});
}

View File

@ -0,0 +1,11 @@
{
"name": "test",
"version": "1.0.0",
"scripts": {
"get-version": "svgo --version > VERSION"
},
"devDependencies": {
"svgo": "2.8.0",
"cssnano": "4.1.10"
}
}