From 36b640d6de311978a511240e826b8f83d47391af Mon Sep 17 00:00:00 2001 From: tgunnoe Date: Tue, 30 Aug 2022 10:43:10 -0400 Subject: [PATCH] Add integration test for #275 --- .../flake.nix | 26 +++++++++++++++++++ .../package.json | 7 +++++ .../yarn.lock | 7 +++++ 3 files changed, 40 insertions(+) create mode 100644 tests/integration/tests/nodejs_dependency-versions-mismatch/flake.nix create mode 100644 tests/integration/tests/nodejs_dependency-versions-mismatch/package.json create mode 100644 tests/integration/tests/nodejs_dependency-versions-mismatch/yarn.lock diff --git a/tests/integration/tests/nodejs_dependency-versions-mismatch/flake.nix b/tests/integration/tests/nodejs_dependency-versions-mismatch/flake.nix new file mode 100644 index 00000000..dd5128cd --- /dev/null +++ b/tests/integration/tests/nodejs_dependency-versions-mismatch/flake.nix @@ -0,0 +1,26 @@ + +# test: yarn-lock evaluation with @git+ in versions +# +# Detecting regressions of #275. +# +# Evaluation of a package.json and a yarn.lock with special cases for +# versions would cause mismatches between the two: +# ''error: attribute '*' missing' +# +# 1. package.json has a dependency with a version starting with "@git+" +# 2. yarn resolves it in its yarn.lock file to the proper version and reference +# 3. the two are either not parsed correctly or mismatched on evaluation +# +{ + inputs = { + dream2nix.url = "github:nix-community/dream2nix"; + }; + + outputs = {self, dream2nix }: + dream2nix.lib.makeFlakeOutputs { + systems = ["x86_64-linux"]; + config.projectRoot = ./.; + packageOverrides = {}; + source = ./.; + }; +} diff --git a/tests/integration/tests/nodejs_dependency-versions-mismatch/package.json b/tests/integration/tests/nodejs_dependency-versions-mismatch/package.json new file mode 100644 index 00000000..f4002ab3 --- /dev/null +++ b/tests/integration/tests/nodejs_dependency-versions-mismatch/package.json @@ -0,0 +1,7 @@ +{ + "name": "test-git-versions", + "version": "1.0.0", + "dependencies": { + "browser-image-resizer": "git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.2" + } +} diff --git a/tests/integration/tests/nodejs_dependency-versions-mismatch/yarn.lock b/tests/integration/tests/nodejs_dependency-versions-mismatch/yarn.lock new file mode 100644 index 00000000..5b3741f7 --- /dev/null +++ b/tests/integration/tests/nodejs_dependency-versions-mismatch/yarn.lock @@ -0,0 +1,7 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"browser-image-resizer@git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.2": + version "2.2.1-misskey.2" + resolved "git+https://github.com/misskey-dev/browser-image-resizer#a58834f5fe2af9f9f31ff115121aef3de6f9d416"