fix(node): Resolve ace_ibma.Checker is not a constructor error #1845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ace_ibma.Checker is not a constructor error
This PR is related to the following issue(s):
Additional information can be found here:
Currently, the generated
ace-node.js
file is updated multiple times when running in multiple threads, causing theace_ibma.Checker is not a constructor
error while reading it when the file is being overwritten.This commit does the following things:
ace-node.js
file if it exists and create the accessibility checker without overwriting the file.ace-node.js
file instead of attempting to create the constructor from the non-existing file.Due to the above change, we must update the generated file name.
The current file is stored as
<cache-folder-name>/ace-node.js
. If the cache folder is not cleared, this would cause issues when either rule archive or package version is changed, as we are no longer overwriting the file.Suffixing rule and package version to the file name (e.g.
ace-node-3.0.0-3.1.67.js
) prevents this from happening.Testing reference:
To test, run multiple accessibility tests using jest parallelly,
ace_ibma.Checker is not a constructor error
should not occur.To verify that the generated file is not being overwritten, run
fswatch -uvx <cache-folder-path>
I have conducted the following for this PR: