Skip to content

Add package-lock.json so that tests pass #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

benmccann
Copy link
Member

The tests are currently failing on master due to changes in dependencies. This took me a frustratingly long time to get working again. This PR adds a package-lock.json since this is precisely the problem that lock files were designed to solve

@Conduitry
Copy link
Member

What specifically was causing the breakage? In the past year or so I've come around a bit to Luke's position on this, which is that lockfiles hide bugs in libraries and are to be avoided. (They're still good for entire applications.) Someone installing this plugin won't be getting the same versions as we point to in the lockfile.

In this case, it looks like the failure is due to the warnings we're getting from ESLint changing. These should be updated accordingly, instead. It's more important to make sure that we keep testing against new versions of ESLint than it is for our tests to always be green. Needing to update tests sometimes is an unfortunate side-effect of making sure we provide a library that works with newer versions of ESLint.

@Conduitry
Copy link
Member

I've gotten tests to pass locally, with reinstalled dependencies from latest master, with the following changes:

diff --git a/test/samples/block-filenames/expected.json b/test/samples/block-filenames/expected.json
index f40aa65..5a947dd 100644
--- a/test/samples/block-filenames/expected.json
+++ b/test/samples/block-filenames/expected.json
@@ -2,11 +2,11 @@
 	{
 		"ruleId": "curly",
 		"line": 2,
-		"column": 2
+		"column": 12
 	},
 	{
 		"ruleId": "curly",
 		"line": 7,
-		"column": 2
+		"column": 11
 	}
 ]
diff --git a/test/samples/typescript-block-filenames/expected.json b/test/samples/typescript-block-filenames/expected.json
index f40aa65..5a947dd 100644
--- a/test/samples/typescript-block-filenames/expected.json
+++ b/test/samples/typescript-block-filenames/expected.json
@@ -2,11 +2,11 @@
 	{
 		"ruleId": "curly",
 		"line": 2,
-		"column": 2
+		"column": 12
 	},
 	{
 		"ruleId": "curly",
 		"line": 7,
-		"column": 2
+		"column": 11
 	}
 ]
diff --git a/test/samples/typescript-lazy/expected.json b/test/samples/typescript-lazy/expected.json
index 92f574d..92cd992 100644
--- a/test/samples/typescript-lazy/expected.json
+++ b/test/samples/typescript-lazy/expected.json
@@ -157,14 +157,6 @@
 		"endLine": 16,
 		"endColumn": 18
 	},
-	{
-		"ruleId": "module-script-reactive-declaration",
-		"severity": 1,
-		"line": 19,
-		"column": 10,
-		"endLine": 19,
-		"endColumn": 11
-	},
 	{
 		"ruleId": "missing-declaration",
 		"severity": 1,
diff --git a/test/samples/typescript-peer-dependency/expected.json b/test/samples/typescript-peer-dependency/expected.json
index 92f574d..92cd992 100644
--- a/test/samples/typescript-peer-dependency/expected.json
+++ b/test/samples/typescript-peer-dependency/expected.json
@@ -157,14 +157,6 @@
 		"endLine": 16,
 		"endColumn": 18
 	},
-	{
-		"ruleId": "module-script-reactive-declaration",
-		"severity": 1,
-		"line": 19,
-		"column": 10,
-		"endLine": 19,
-		"endColumn": 11
-	},
 	{
 		"ruleId": "missing-declaration",
 		"severity": 1,
diff --git a/test/samples/typescript/expected.json b/test/samples/typescript/expected.json
index e598e26..92cd992 100644
--- a/test/samples/typescript/expected.json
+++ b/test/samples/typescript/expected.json
@@ -157,14 +157,6 @@
 		"endLine": 16,
 		"endColumn": 18
 	},
-	{
-		"ruleId": "module-script-reactive-declaration",
-		"severity": 1,
-		"line": 19,
-		"column": 10,
-		"endLine": 19,
-		"endColumn": 11
-	},
 	{
 		"ruleId": "missing-declaration",
 		"severity": 1,
@@ -181,4 +173,4 @@
 		"endLine": 23,
 		"endColumn": 6
 	}
-]
\ No newline at end of file
+]

ESLint appears to have changed where it points to for certain errors, and Svelte is more discerning about when it returns a module-script-reactive-declaration warning. IMO we should just make these updates to the tests rather than pinning specific versions of various dependencies.

@LumaKernel
Copy link
Contributor

Keeping up to date is important but lockfile must be important clue for step-by-step debugging outdated testing. IMO, it can be a choice to have lockfile with keep updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants