Skip to content
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

fix(browserify/test): result output references in error handling #960

Merged
merged 1 commit into from Jan 30, 2024

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented Jan 26, 2024

Fixes regression in error-handling in browserify tests introduced in f4292a0 (#698) where a non-existent res is referred in error-handling.

Ideally cases like this would be caught by lint.

@github-actions github-actions bot added chore overhead, tests, dev env, etc. pkg:lavamoat-browserify Changes in package lavamoat-browserify labels Jan 26, 2024
@legobeat legobeat added bug Something isn't working chore overhead, tests, dev env, etc. and removed chore overhead, tests, dev env, etc. labels Jan 26, 2024
@legobeat legobeat marked this pull request as ready for review January 29, 2024 22:09
@legobeat legobeat requested a review from a team as a code owner January 29, 2024 22:09
@boneskull
Copy link
Contributor

IIRC, I disabled the no-undef rule for tests because we use a lot of undefined variables in tests.

/Users/boneskull/projects/lavamoat/lavamoat/packages/browserify/test/globalRef.spec.js
  62:9  error  'checkThis' is not defined    no-undef
  67:9  error  'checkSelf' is not defined    no-undef
  72:9  error  'checkWindow' is not defined  no-undef
  77:9  error  'checkGlobal' is not defined  no-undef

/Users/boneskull/projects/lavamoat/lavamoat/packages/browserify/test/globalWrites.spec.js
  16:7   error  'xyz' is not defined  no-undef
  20:24  error  'xyz' is not defined  no-undef

/Users/boneskull/projects/lavamoat/lavamoat/packages/browserify/test/util.js
  42:17  error  'res' is not defined  no-undef
  45:12  error  'res' is not defined  no-undef
  46:15  error  'res' is not defined  no-undef

/Users/boneskull/projects/lavamoat/lavamoat/packages/core/test/globals.spec.js
   96:26  error  'xyz' is not defined     no-undef
  157:16  error  'abc' is not defined     no-undef
  158:22  error  'abc' is not defined     no-undef
  159:17  error  'abc' is not defined     no-undef
  160:15  error  'abc' is not defined     no-undef
  398:20  error  'chrome' is not defined  no-undef

/Users/boneskull/projects/lavamoat/lavamoat/packages/lavapack/test/sourcemaps.spec.js
  16:18  error  'UglifyJS' is not defined           no-undef
  55:30  error  'SourceMapConsumer' is not defined  no-undef

/Users/boneskull/projects/lavamoat/lavamoat/packages/tofu/test/inspectGlobals.spec.js
   17:15  error  'xyz' is not defined       no-undef
   22:7   error  'abc' is not defined       no-undef
   54:15  error  'zzz' is not defined       no-undef
   67:15  error  'a' is not defined         no-undef
   67:21  error  'b' is not defined         no-undef
   67:27  error  'c' is not defined         no-undef
   80:5   error  'xyz' is not defined       no-undef
   91:5   error  'z' is not defined         no-undef
   91:9   error  'xyz' is not defined       no-undef
   92:5   error  'xyz' is not defined       no-undef
   94:8   error  'abc' is not defined       no-undef
  109:5   error  'zzz' is not defined       no-undef
  122:15  error  'zzz' is not defined       no-undef
  133:5   error  'zzz' is not defined       no-undef
  133:15  error  'xyz' is not defined       no-undef
  160:5   error  'abc' is not defined       no-undef
  174:5   error  'abc' is not defined       no-undef
  409:9   error  'manifest' is not defined  no-undef
  423:5   error  'manifest' is not defined  no-undef

We should re-enable the rule and then disable it on a file-by-file basis.

@legobeat legobeat merged commit 791a6af into LavaMoat:main Jan 30, 2024
8 checks passed
@legobeat legobeat deleted the fix-test-error-handling branch January 30, 2024 21:20
legobeat pushed a commit that referenced this pull request Feb 6, 2024
boneskull added a commit that referenced this pull request Mar 8, 2024
boneskull added a commit that referenced this pull request Mar 8, 2024
boneskull added a commit that referenced this pull request Mar 11, 2024
boneskull added a commit that referenced this pull request Mar 12, 2024
boneskull added a commit that referenced this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore overhead, tests, dev env, etc. pkg:lavamoat-browserify Changes in package lavamoat-browserify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants