From e1b59d63a7821bf39e4bcf7d358be3a33b8626c8 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Thu, 14 Dec 2023 11:48:22 -0800 Subject: [PATCH] Update README with new instructions on how to run the gentest script (#1502) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1502 We should change this if we are moving away from using Ruby Reviewed By: yungsters, NickGerleman Differential Revision: D51957351 fbshipit-source-id: fddb0b3348db2b93c661c919a61150c81906a61a --- README.md | 9 ++++----- package.json | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 00972de2..2e6e5c50 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages. - ## Building + Yoga's main implementation targets C++ 20 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests. ```sh @@ -14,8 +14,6 @@ While not required, this script will use [ninja](https://ninja-build.org/) if it Yoga is additionally part of the [vcpkg](https://github.com/Microsoft/vcpkg/) collection of ports maintained by Microsoft and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. - - ## Adding Tests Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to `gentest/fixtures`. @@ -27,9 +25,10 @@ Many of Yoga's tests are automatically generated, using HTML fixtures describing ``` To generate new tests from added fixtures: -1. Run `bundle install` in the `gentest` directory to install dependencies of the test generator. -2. Run `ruby gentest.rb` in the `gentest` directory. +1. Ensure you have [yarn](https://yarnpkg.com/) installed. +2. Run `yarn install` to install dependencies for the test generator. +3. Run `yarn gentest` in the `yoga` directory. ## Debugging diff --git a/package.json b/package.json index bab221a2..e5121d61 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "lint": "eslint .", "lint:fix": "eslint . --fix", - "tsc": "yarn workspaces run tsc" + "tsc": "yarn workspaces run tsc", + "gentest": "node --loader=babel-register-esm gentest/gentest-driver.ts" }, "workspaces": [ "javascript", @@ -15,6 +16,7 @@ "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", + "babel-register-esm": "^1.2.5", "eslint": "^8.30.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jest": "^27.1.7",