Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan <[email protected]>
  • Loading branch information
mstoykov and codebien authored Jul 19, 2024
1 parent d89bf0c commit 0962829
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions js/tc39/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Introduction to a k6's TC39 testing

This module tests k6 [Sobek](https://github.com/grafana/sobek) and the k6 Sobek+esbuild combo against the tc39 test suite.
`js/tc39` package tests k6 [Sobek](https://github.com/grafana/sobek) and the k6 Sobek+esbuild combo against the tc39 test suite.

Ways to use it:
1. run ./checkout.sh to checkout the last commit sha of [test262](https://github.com/tc39/test262)
that was tested with this module
2. Run `go test &> out.log`

The 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.
Due to changes to Sobek it is not uncommon for the error to change, or there to be now a new error on previously passing test, or (hopefully) a test that was not passing but now is.
Due to changes to Sobek it's common for the error to change, or there to be now a new error on the previously passing test, or (hopefully) a test that was not passing but now is.
In all of those cases `breaking_test_errors-*.json` needs to be updated. Run the test with `-update` flag to update: `go test -update`

NOTE: some text editors/IDEs will try to parse files ending in `json` as JSON, which given the size of `breaking_test_errors-*.json` might be a problem when it's not actually a JSON (before the edit). So it might be a better idea to name it something different if editing by hand and fix it later.
Expand All @@ -27,6 +27,6 @@ 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, it is mostly for testing esbuild, but also due to Sobek not testing a lot more stuff. It is still possible that we drop this whole package in the future.
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.
4 changes: 2 additions & 2 deletions lib/runtime_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
type CompatibilityMode uint8

const (
// CompatibilityModeExtended adds global as alias for globalThis on top of the base
// CompatibilityModeExtended adds `global` as an alias for `globalThis` on top of the base mode
CompatibilityModeExtended CompatibilityMode = iota + 1
// CompatibilityModeBase is standard Sobek
// CompatibilityModeBase is standard Sobek, which means pure vanilla JS following ECMAScript standards.
CompatibilityModeBase
// CompatibilityModeExperimentalEnhanced achieves TypeScript and ES6+ compatibility with esbuild
CompatibilityModeExperimentalEnhanced
Expand Down

0 comments on commit 0962829

Please sign in to comment.