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

test: add test case for #114 #116

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

gregmagolan
Copy link
Member

@gregmagolan gregmagolan commented Apr 5, 2023

Description

Follow-up to #114 to add test case for the fix.

Type of change

  • Missing test case

Test plan

How has this been tested?

  • New test cases added

@gregmagolan gregmagolan merged commit a486b66 into main Apr 5, 2023
@gregmagolan gregmagolan deleted the update_snapshot_js_binary_data_test branch April 5, 2023 23:35
@gregmagolan
Copy link
Member Author

This test case is able to reproduce the issue with the fix from #114 reverted:

$ bazel run //jest/tests/package_json_module:test_update_snapshots
INFO: Analyzed target //jest/tests/package_json_module:test_update_snapshots (0 packages loaded, 1153 targets configured).
INFO: Found 1 target...
ERROR: /Users/greg/aspect/rules/js/rules_jest/jest/tests/package_json_module/BUILD.bazel:5:10: JsRunBinary jest/tests/package_json_module/__snapshots__/out failed: (Exit 1): test_ref_snapshots_bin.sh failed: error executing command (from target //jest/tests/package_json_module:test_ref_snapshots) bazel-out/darwin-opt-exec-2B5CBBC6/bin/jest/tests/package_json_module/test_ref_snapshots_bin.sh

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
(node:17566) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/private/var/tmp/_bazel_greg/7cc4e1b5949d1d1241c5086c6b8f4c79/execroot/aspect_rules_jest/bazel-out/darwin-opt-exec-2B5CBBC6/bin/jest/tests/package_json_module/jest.config.js:1
export default {
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1094:15)
    at Module._compile (node:internal/modules/cjs/loader:1129:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
    at Module.load (node:internal/modules/cjs/loader:1043:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
Target //jest/tests/package_json_module:test_update_snapshots failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.961s, Critical Path: 2.86s
INFO: 934 processes: 649 internal, 285 local.
ERROR: Build failed. Not running target
FAILED: Build did NOT complete successfully

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.

2 participants