internal/js/tc39/README.md
js/tc39 package tests k6 Sobek and the k6 Sobek+esbuild combo against the tc39 test suite.
Ways to use it:
go test &> out.logThe full list of failing tests, and the error, is in breaking_test_errors-*.json. All errors list there with the corresponding error will not be counted as errors - this is what the test expects, those specific errors. See reasons for this at the end of this document.
This is a modified version of the code in the original goja repo that Sobek was forked from.
There are few things to keep in mind when maintaining the tests.
featuresBlockList, skipList and any other list in the tc39_test.go file. The way to go is also keeping this lists closer to the Sobek, however they are not the same, so you might need to adjust them.breaking_test_errors-*.json needs to be updated. Run the test with -update flag to update: go test -update.breaking_test_errors-*.json and case by case decide if the error should be updated or the test should be fixed.Unfortunately k6 doesn't pass all the test that are currently defined as "interesting". Goja decided to just not run the ones that it knows it fails currently, but this means that if they stop failing, someone needs to go re-enable these tests.
This also means that, if the previous breakage was something a user can work around in a certain way, it now might be something else that the user can't workaround or have another problem.
Starting v0.53 k6 doesn't use Babel anymore, it now serves tests for esbuild, and for the parts uncovered by Sobek's test suite. It is still possible that we drop the whole package in the future.
For these reasons, I decided that recording what breaks and checking that it doesn't change is better.