diff --git a/tests/integration/tests/nodejs_direct-priority-over-transitive/flake.nix b/tests/integration/tests/nodejs_direct-priority-over-transitive/flake.nix new file mode 100644 index 00000000..568ac497 --- /dev/null +++ b/tests/integration/tests/nodejs_direct-priority-over-transitive/flake.nix @@ -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 + ''; + }; + }; + }; + }); +} diff --git a/tests/integration/tests/nodejs_direct-priority-over-transitive/package.json b/tests/integration/tests/nodejs_direct-priority-over-transitive/package.json new file mode 100644 index 00000000..c06d8fdc --- /dev/null +++ b/tests/integration/tests/nodejs_direct-priority-over-transitive/package.json @@ -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" + } +}