From 8d3e02f5658a67caea055ff7ae55d3502ad533d4 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Tue, 22 Nov 2022 15:05:05 +0300 Subject: [PATCH 01/47] migrate to emscripten --- javascript/Makefile | 31 + javascript/autogypi.json | 6 - javascript/binding.gyp | 28 - javascript/final-flags.gypi | 32 -- javascript/package.json | 30 +- javascript/sources/Config.hh | 2 - javascript/sources/Layout.hh | 8 +- javascript/sources/Node.cc | 23 +- javascript/sources/Node.hh | 42 +- javascript/sources/Size.hh | 5 - javascript/sources/Value.hh | 4 +- javascript/sources/embind.cc | 188 ++++++ javascript/sources/entry-browser.js | 55 -- .../sources/{entry-common.js => entry.js} | 24 +- .../sources/{entry-node.js => index.js} | 12 +- javascript/sources/nbind.cc | 175 ------ javascript/yarn.lock | 541 +----------------- 17 files changed, 311 insertions(+), 895 deletions(-) create mode 100644 javascript/Makefile delete mode 100644 javascript/autogypi.json delete mode 100644 javascript/binding.gyp delete mode 100644 javascript/final-flags.gypi create mode 100644 javascript/sources/embind.cc delete mode 100644 javascript/sources/entry-browser.js rename javascript/sources/{entry-common.js => entry.js} (93%) rename javascript/sources/{entry-node.js => index.js} (67%) delete mode 100644 javascript/sources/nbind.cc diff --git a/javascript/Makefile b/javascript/Makefile new file mode 100644 index 00000000..74e5432a --- /dev/null +++ b/javascript/Makefile @@ -0,0 +1,31 @@ +CC=emcc + +all: clean dir asm + +asm: + $(CC) sources/yoga/*.cpp sources/*.cc \ + --bind \ + -Isources \ + -g0 \ + -Os \ + --memory-init-file 0 \ + -s WASM=0 \ + -s WASM_ASYNC_COMPILATION=0 \ + -s USE_ES6_IMPORT_META=0 \ + -s MODULARIZE=1 \ + -s ASSERTIONS=0 \ + -s ALLOW_MEMORY_GROWTH=1 \ + -s DYNAMIC_EXECUTION=0 \ + -s TEXTDECODER=0 \ + -s ENVIRONMENT='web' \ + -s ERROR_ON_UNDEFINED_SYMBOLS=0 \ + -s FILESYSTEM=0 \ + -s MALLOC="emmalloc" \ + -s EXPORT_NAME="yoga" \ + -o dist/asm.js + +clean: + rm -rf dist + +dir: + mkdir -p dist diff --git a/javascript/autogypi.json b/javascript/autogypi.json deleted file mode 100644 index b81b491c..00000000 --- a/javascript/autogypi.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": [ - "nbind" - ], - "includes": [] -} diff --git a/javascript/binding.gyp b/javascript/binding.gyp deleted file mode 100644 index da48de18..00000000 --- a/javascript/binding.gyp +++ /dev/null @@ -1,28 +0,0 @@ -{ - "targets": [{ - "includes": [ - "auto.gypi", - "final-flags.gypi" - ], - - "sources": [ - " -#include #include class Config { diff --git a/javascript/sources/Layout.hh b/javascript/sources/Layout.hh index 1116ad84..1459fbe3 100644 --- a/javascript/sources/Layout.hh +++ b/javascript/sources/Layout.hh @@ -7,9 +7,6 @@ #pragma once -#include -#include - struct Layout { double left; double right; @@ -19,8 +16,5 @@ struct Layout { double width; double height; - - void toJS(nbind::cbOutput expose) const { - expose(left, right, top, bottom, width, height); - } }; + diff --git a/javascript/sources/Node.cc b/javascript/sources/Node.cc index 9fc631b7..fa6fc69f 100644 --- a/javascript/sources/Node.cc +++ b/javascript/sources/Node.cc @@ -242,7 +242,7 @@ int Node::getPositionType(void) const { Value Node::getPosition(int edge) const { return Value::fromYGValue( - YGNodeStyleGetPosition(m_node, static_cast(edge))); + YGNodeStyleGetPosition(m_node, static_cast(edge))); } int Node::getAlignContent(void) const { @@ -271,7 +271,7 @@ int Node::getJustifyContent(void) const { Value Node::getMargin(int edge) const { return Value::fromYGValue( - YGNodeStyleGetMargin(m_node, static_cast(edge))); + YGNodeStyleGetMargin(m_node, static_cast(edge))); } int Node::getOverflow(void) const { @@ -328,12 +328,11 @@ double Node::getBorder(int edge) const { Value Node::getPadding(int edge) const { return Value::fromYGValue( - YGNodeStyleGetPadding(m_node, static_cast(edge))); + YGNodeStyleGetPadding(m_node, static_cast(edge))); } -Value Node::getGap(int gutter, ) { - return Value::fromYGValue( - YGNodeStyleGetGap(m_node, static_cast(gutter))); +float Node::getGap(int gutter) { + return YGNodeStyleGetGap(m_node, static_cast(gutter)); } bool Node::isReferenceBaseline() { @@ -370,8 +369,8 @@ Node* Node::getChild(unsigned index) { return Node::fromYGNode(nodePtr); } -void Node::setMeasureFunc(nbind::cbFunction& measureFunc) { - m_measureFunc.reset(new nbind::cbFunction(measureFunc)); +void Node::setMeasureFunc(MeasureCallback *measureFunc) { + m_measureFunc.reset(measureFunc); YGNodeSetMeasureFunc(m_node, &globalMeasureFunc); } @@ -387,11 +386,11 @@ Size Node::callMeasureFunc( int widthMode, double height, int heightMode) const { - return m_measureFunc->call(width, widthMode, height, heightMode); + return m_measureFunc->measure(width, widthMode, height, heightMode); } -void Node::setDirtiedFunc(nbind::cbFunction& dirtiedFunc) { - m_dirtiedFunc.reset(new nbind::cbFunction(dirtiedFunc)); +void Node::setDirtiedFunc(DirtiedCallback *dirtiedFunc) { + m_dirtiedFunc.reset(dirtiedFunc); YGNodeSetDirtiedFunc(m_node, &globalDirtiedFunc); } @@ -403,7 +402,7 @@ void Node::unsetDirtiedFunc(void) { } void Node::callDirtiedFunc(void) const { - m_dirtiedFunc->call(); + m_dirtiedFunc->dirtied(); } void Node::markDirty(void) { diff --git a/javascript/sources/Node.hh b/javascript/sources/Node.hh index 1a984033..35df0f8c 100644 --- a/javascript/sources/Node.hh +++ b/javascript/sources/Node.hh @@ -9,8 +9,7 @@ #include -#include -#include +#include #include #include "./Layout.hh" @@ -18,6 +17,33 @@ #include "./Value.hh" #include "./Config.hh" +struct MeasureCallback { + virtual Size measure(float width, + int widthMode, + float height, + int heightMode) = 0; +}; + +struct MeasureCallbackWrapper : public emscripten::wrapper { + EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper); + Size measure(float width, int widthMode, float height, int heightMode) + { + return call("measure", width, widthMode, height, heightMode); + } +}; + +struct DirtiedCallback { + virtual void dirtied() = 0; +}; + +struct DirtiedCallbackWrapper : public emscripten::wrapper { + EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper); + void dirtied() + { + return call("dirtied"); + } +}; + class Node { public: @@ -131,8 +157,8 @@ public: // Style getters double getBorder(int edge) const; Value getPadding(int edge) const; - - Value getGap(int gutter); + + float getGap(int gutter); public: // Tree hierarchy mutators void insertChild(Node* child, unsigned index); @@ -148,7 +174,7 @@ public: // Tree hierarchy inspectors Node* getChild(unsigned index); public: // Measure func mutators - void setMeasureFunc(nbind::cbFunction& measureFunc); + void setMeasureFunc(MeasureCallback *measureFunc); void unsetMeasureFunc(void); public: // Measure func inspectors @@ -159,7 +185,7 @@ public: // Measure func inspectors int heightMode) const; public: // Dirtied func mutators - void setDirtiedFunc(nbind::cbFunction& dirtiedFunc); + void setDirtiedFunc(DirtiedCallback *dirtiedFunc); void unsetDirtiedFunc(void); public: // Dirtied func inspectors @@ -194,6 +220,6 @@ public: YGNodeRef m_node; - std::unique_ptr m_measureFunc; - std::unique_ptr m_dirtiedFunc; + std::unique_ptr m_measureFunc; + std::unique_ptr m_dirtiedFunc; }; diff --git a/javascript/sources/Size.hh b/javascript/sources/Size.hh index 906ec7f1..c42bb90a 100644 --- a/javascript/sources/Size.hh +++ b/javascript/sources/Size.hh @@ -7,9 +7,6 @@ #pragma once -#include -#include - struct Size { double width; double height; @@ -17,6 +14,4 @@ struct Size { Size(void) : width(0.0), height(0.0) {} Size(double width, double height) : width(width), height(height) {} - - void toJS(nbind::cbOutput expose) const { expose(width, height); } }; diff --git a/javascript/sources/Value.hh b/javascript/sources/Value.hh index b7948e5b..38267dea 100644 --- a/javascript/sources/Value.hh +++ b/javascript/sources/Value.hh @@ -19,7 +19,5 @@ struct Value { Value(void) : unit(YGUnitUndefined), value(0.0) {} - Value(int unit, double value) : unit(unit), value(value) {} - - void toJS(nbind::cbOutput expose) const { expose(unit, value); } + Value(int unit, double value) : unit(unit), value(value) {} }; diff --git a/javascript/sources/embind.cc b/javascript/sources/embind.cc new file mode 100644 index 00000000..32ee65ad --- /dev/null +++ b/javascript/sources/embind.cc @@ -0,0 +1,188 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "./Node.hh" +#include "./Layout.hh" +#include "./Size.hh" +#include "./Value.hh" +#include "./Config.hh" + +#include +#include + +using namespace emscripten; + +EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) { + class_("MeasureCallback") + .function("measure", &MeasureCallback::measure, pure_virtual()) + .allow_subclass("MeasureCallbackWrapper") + ; + class_("DirtiedCallback") + .function("dirtied", &DirtiedCallback::dirtied, pure_virtual()) + .allow_subclass("DirtiedCallbackWrapper") + ; + + class_("Config") + .constructor<>(&Config::create, allow_raw_pointers()) + .class_function<>("create", &Config::create, allow_raw_pointers()) + .class_function<>("destroy", &Config::destroy, allow_raw_pointers()) + .function("setExperimentalFeatureEnabled", &Config::setExperimentalFeatureEnabled) + .function("setPointScaleFactor", &Config::setPointScaleFactor) + .function("isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled) + ; + + value_object("Layout") + .field("left", &Layout::left) + .field("right", &Layout::right) + .field("top", &Layout::top) + .field("bottom", &Layout::bottom) + .field("width", &Layout::width) + .field("height", &Layout::height) + ; + + value_object("Size") + .field("width", &Size::width) + .field("height", &Size::height) + ; + + value_object("Value") + .field("value", &Value::value) + .field("unit", &Value::unit) + ; + + class_("Node") + .constructor<>(&Node::createDefault, allow_raw_pointers()) + + .class_function<>("createDefault", &Node::createDefault, allow_raw_pointers()) + .class_function<>("createWithConfig", &Node::createWithConfig, allow_raw_pointers()) + .class_function<>("destroy", &Node::destroy, allow_raw_pointers()) + .function("reset", &Node::reset) + + .function("copyStyle", &Node::copyStyle) + + .function("setPositionType", &Node::setPositionType) + .function("setPosition", &Node::setPosition) + .function("setPositionPercent", &Node::setPositionPercent) + + .function("setAlignContent", &Node::setAlignContent) + .function("setAlignItems", &Node::setAlignItems) + .function("setAlignSelf", &Node::setAlignSelf) + .function("setFlexDirection", &Node::setFlexDirection) + .function("setFlexWrap", &Node::setFlexWrap) + .function("setJustifyContent", &Node::setJustifyContent) + + .function("setMargin", &Node::setMargin) + .function("setMarginPercent", &Node::setMarginPercent) + .function("setMarginAuto", &Node::setMarginAuto) + + .function("setOverflow", &Node::setOverflow) + .function("setDisplay", &Node::setDisplay) + + .function("setFlex", &Node::setFlex) + .function("setFlexBasis", &Node::setFlexBasis) + .function("setFlexBasisPercent", &Node::setFlexBasisPercent) + .function("setFlexGrow", &Node::setFlexGrow) + .function("setFlexShrink", &Node::setFlexShrink) + + .function("setWidth", &Node::setWidth) + .function("setWidthPercent", &Node::setWidthPercent) + .function("setWidthAuto", &Node::setWidthAuto) + .function("setHeight", &Node::setHeight) + .function("setHeightPercent", &Node::setHeightPercent) + .function("setHeightAuto", &Node::setHeightAuto) + + .function("setMinWidth", &Node::setMinWidth) + .function("setMinWidthPercent", &Node::setMinWidthPercent) + .function("setMinHeight", &Node::setMinHeight) + .function("setMinHeightPercent", &Node::setMinHeightPercent) + + .function("setMaxWidth", &Node::setMaxWidth) + .function("setMaxWidthPercent", &Node::setMaxWidthPercent) + .function("setMaxHeight", &Node::setMaxHeight) + .function("setMaxHeightPercent", &Node::setMaxHeightPercent) + + .function("setAspectRatio", &Node::setAspectRatio) + + .function("setBorder", &Node::setBorder) + + .function("setPadding", &Node::setPadding) + .function("setPaddingPercent", &Node::setPaddingPercent) + .function("setGap", &Node::setGap) + + .function("getPositionType", &Node::getPositionType) + .function("getPosition", &Node::getPosition) + + .function("getAlignContent", &Node::getAlignContent) + .function("getAlignItems", &Node::getAlignItems) + .function("getAlignSelf", &Node::getAlignSelf) + .function("getFlexDirection", &Node::getFlexDirection) + .function("getFlexWrap", &Node::getFlexWrap) + .function("getJustifyContent", &Node::getJustifyContent) + + .function("getMargin", &Node::getMargin) + + .function("getFlexBasis", &Node::getFlexBasis) + .function("getFlexGrow", &Node::getFlexGrow) + .function("getFlexShrink", &Node::getFlexShrink) + + .function("getWidth", &Node::getWidth) + .function("getHeight", &Node::getHeight) + + .function("getMinWidth", &Node::getMinWidth) + .function("getMinHeight", &Node::getMinHeight) + + .function("getMaxWidth", &Node::getMaxWidth) + .function("getMaxHeight", &Node::getMaxHeight) + + .function("getAspectRatio", &Node::getAspectRatio) + + .function("getBorder", &Node::getBorder) + + .function("getOverflow", &Node::getOverflow) + .function("getDisplay", &Node::getDisplay) + + .function("getPadding", &Node::getPadding) + .function("getGap", &Node::getGap) + + .function("insertChild", &Node::insertChild, allow_raw_pointers()) + .function("removeChild", &Node::removeChild, allow_raw_pointers()) + + .function("getChildCount", &Node::getChildCount) + + .function("getParent", &Node::getParent, allow_raw_pointers()) + .function("getChild", &Node::getChild, allow_raw_pointers()) + + .function("isReferenceBaseline", &Node::isReferenceBaseline) + .function("setIsReferenceBaseline", &Node::setIsReferenceBaseline) + + .function("setMeasureFunc", &Node::setMeasureFunc, allow_raw_pointers()) + .function("unsetMeasureFunc", &Node::unsetMeasureFunc) + + .function("setDirtiedFunc", &Node::setDirtiedFunc, allow_raw_pointers()) + .function("unsetDirtiedFunc", &Node::unsetDirtiedFunc) + + .function("markDirty", &Node::markDirty) + .function("isDirty", &Node::isDirty) + + .function("calculateLayout", &Node::calculateLayout) + + .function("getComputedLeft", &Node::getComputedLeft) + .function("getComputedRight", &Node::getComputedRight) + + .function("getComputedTop", &Node::getComputedTop) + .function("getComputedBottom", &Node::getComputedBottom) + + .function("getComputedWidth", &Node::getComputedWidth) + .function("getComputedHeight", &Node::getComputedHeight) + + .function("getComputedLayout", &Node::getComputedLayout) + + .function("getComputedMargin", &Node::getComputedMargin) + .function("getComputedBorder", &Node::getComputedBorder) + .function("getComputedPadding", &Node::getComputedPadding) + ; +} diff --git a/javascript/sources/entry-browser.js b/javascript/sources/entry-browser.js deleted file mode 100644 index 118e95fc..00000000 --- a/javascript/sources/entry-browser.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -const Yoga = require('./entry-common'); -const nbind = require('../build/Release/nbind.js'); - -let ran = false; -let ret = null; - -nbind({}, function(err, result) { - if (ran) { - return; - } - - ran = true; - - if (err) { - throw err; - } - - ret = result; -}); - -if (!ran) { - throw new Error( - "Failed to load the yoga module - it needed to be loaded synchronously, but didn't", - ); -} - -// $FlowFixMe ret will not be null here -module.exports = Yoga(ret.bind, ret.lib); - -export type { - Yoga$Justify, - Yoga$Align, - Yoga$FlexDirection, - Yoga$Direction, - Yoga$Wrap, - Yoga$Gutter, - Yoga$Edge, - Yoga$Display, - Yoga$Unit, - Yoga$Overflow, - Yoga$PositionType, - Yoga$ExperimentalFeature, -} from './YGEnums.js'; - -export type {Yoga$Node, Yoga$Config} from './entry-common'; diff --git a/javascript/sources/entry-common.js b/javascript/sources/entry.js similarity index 93% rename from javascript/sources/entry-common.js rename to javascript/sources/entry.js index 7a0a753f..d7b6f419 100644 --- a/javascript/sources/entry-common.js +++ b/javascript/sources/entry.js @@ -234,7 +234,7 @@ type Yoga = { ...typeof CONSTANTS, }; -module.exports = (bind: any, lib: any): Yoga => { +module.exports = (lib: any): Yoga => { function patch(prototype, name, fn) { let original = prototype[name]; @@ -298,6 +298,22 @@ module.exports = (bind: any, lib: any): Yoga => { }); } + function wrapMeasureFunction(measureFunction) { + return lib.MeasureCallback.implement({ measure: measureFunction }) + } + + patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) { + original.call(this, wrapMeasureFunction(measureFunc)) + }) + + function wrapDirtiedFunc(dirtiedFunction) { + return lib.DirtiedCallback.implement({ dirtied: dirtiedFunction }) + } + + patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) { + original.call(this, wrapDirtiedFunc(dirtiedFunc)) + }) + patch(lib.Config.prototype, 'free', function() { // Since we handle the memory allocation ourselves (via lib.Config.create), // we also need to handle the deallocation @@ -352,9 +368,9 @@ module.exports = (bind: any, lib: any): Yoga => { return { Config: lib.Config, Node: lib.Node, - Layout: bind('Layout', Layout), - Size: bind('Size', Size), - Value: bind('Value', Value), + Layout: Layout, + Size: Size, + Value: Value, ...CONSTANTS, }; }; diff --git a/javascript/sources/entry-node.js b/javascript/sources/index.js similarity index 67% rename from javascript/sources/entry-node.js rename to javascript/sources/index.js index f70b6c0c..6f361604 100644 --- a/javascript/sources/entry-node.js +++ b/javascript/sources/index.js @@ -8,10 +8,12 @@ * @format */ -const Yoga = require('./entry-common'); -const nbind = require('nbind'); -const {bind, lib} = nbind.init(__dirname + '/../'); -module.exports = Yoga(bind, lib); +const entry = require('./entry'); +const yoga = require('./asm'); + +// $FlowFixMe ret will not be null here +module.exports = entry(yoga()); + export type { Yoga$Justify, Yoga$Align, @@ -27,4 +29,4 @@ export type { Yoga$ExperimentalFeature, } from './YGEnums.js'; -export type {Yoga$Node, Yoga$Config} from './entry-common'; +export type {Yoga$Node, Yoga$Config} from './entry'; diff --git a/javascript/sources/nbind.cc b/javascript/sources/nbind.cc deleted file mode 100644 index 385935ba..00000000 --- a/javascript/sources/nbind.cc +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include - -#include "./Node.hh" -#include "./Layout.hh" -#include "./Size.hh" -#include "./Value.hh" -#include "./Config.hh" - -#include - -NBIND_CLASS(Size) { - construct<>(); - construct(); -} - -NBIND_CLASS(Layout) { - construct<>(); -} - -NBIND_CLASS(Value) { - construct<>(); - construct(); -} - -NBIND_CLASS(Config) { - method(create); - - method(destroy); - - method(setExperimentalFeatureEnabled); - method(setPointScaleFactor); - - method(isExperimentalFeatureEnabled); -} - -NBIND_CLASS(Node) { - method(createDefault); - method(createWithConfig); - method(destroy); - - method(reset); - - method(copyStyle); - - method(setPositionType); - method(setPosition); - method(setPositionPercent); - - method(setAlignContent); - method(setAlignItems); - method(setAlignSelf); - method(setFlexDirection); - method(setFlexWrap); - method(setJustifyContent); - - method(setMargin); - method(setMarginPercent); - method(setMarginAuto); - - method(setOverflow); - method(setDisplay); - - method(setFlex); - method(setFlexBasis); - method(setFlexBasisPercent); - method(setFlexBasisAuto); - method(setFlexGrow); - method(setFlexShrink); - - method(setWidth); - method(setWidthPercent); - method(setWidthAuto); - method(setHeight); - method(setHeightPercent); - method(setHeightAuto); - - method(setMinWidth); - method(setMinWidthPercent); - method(setMinHeight); - method(setMinHeightPercent); - - method(setMaxWidth); - method(setMaxWidthPercent); - method(setMaxHeight); - method(setMaxHeightPercent); - - method(setAspectRatio); - - method(setBorder); - - method(setPadding); - method(setPaddingPercent); - - method(setGap); - - method(getPositionType); - method(getPosition); - - method(getAlignContent); - method(getAlignItems); - method(getAlignSelf); - method(getFlexDirection); - method(getFlexWrap); - method(getJustifyContent); - - method(getMargin); - - method(getFlexBasis); - method(getFlexGrow); - method(getFlexShrink); - - method(getWidth); - method(getHeight); - - method(getMinWidth); - method(getMinHeight); - - method(getMaxWidth); - method(getMaxHeight); - - method(getAspectRatio); - - method(getBorder); - - method(getOverflow); - method(getDisplay); - - method(getPadding); - - method(getGap); - - method(insertChild); - method(removeChild); - - method(getChildCount); - - method(getParent); - method(getChild); - - method(isReferenceBaseline); - method(setIsReferenceBaseline); - - method(setMeasureFunc); - method(unsetMeasureFunc); - - method(setDirtiedFunc); - method(unsetDirtiedFunc); - - method(markDirty); - method(isDirty); - - method(calculateLayout); - - method(getComputedLeft); - method(getComputedRight); - - method(getComputedTop); - method(getComputedBottom); - - method(getComputedWidth); - method(getComputedHeight); - - method(getComputedLayout); - - method(getComputedMargin); - method(getComputedBorder); - method(getComputedPadding); -} diff --git a/javascript/yarn.lock b/javascript/yarn.lock index 08abeebf..c79ab1d4 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -2,21 +2,6 @@ # yarn lockfile v1 -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -ajv@^6.12.3: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -55,19 +40,6 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.7" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146" - integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -100,18 +72,6 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== -asn1@~0.2.3: - version "0.2.6" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" - integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -122,35 +82,11 @@ async-each@^1.0.0: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - atob@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -autogypi@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/autogypi/-/autogypi-0.2.2.tgz#258bab5f7857755b09beac6a641fea130ff4622d" - integrity sha512-NkDsjbybxo98NEUpvDULvV6w4OxhnX8owBptd8/GlQLhi81TZrh7siRYX9zVEoAYpYaX5QrRuIZAtgYD9PGDXg== - dependencies: - bluebird "^3.4.0" - commander "~2.9.0" - resolve "~1.1.7" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - babel-cli@^6.24.1: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" @@ -763,13 +699,6 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== - dependencies: - tweetnacl "^0.14.3" - binary-extensions@^1.0.0: version "1.13.1" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" @@ -787,18 +716,6 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - integrity sha512-OorbnJVPII4DuUKbjARAe8u8EfqOmkEEaSFIyoQ7OjTHn6kafxWl0wLgoZ2rXaYd7MyLcDaU4TmhfxtwgcccMQ== - dependencies: - inherits "~2.0.0" - -bluebird@^3.4.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -864,11 +781,6 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== - chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -930,11 +842,6 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== - collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -955,14 +862,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@2.9.0, commander@~2.9.0: +commander@2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" integrity sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A== @@ -984,11 +884,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== - convert-source-map@^1.5.0, convert-source-map@^1.5.1: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -1006,11 +901,6 @@ core-js@^2.4.0, core-js@^2.5.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== - core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -1033,13 +923,6 @@ cross-spawn@^5.1.0: shebang-command "^1.2.0" which "^1.2.9" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== - dependencies: - assert-plus "^1.0.0" - debug@2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" @@ -1086,16 +969,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== - detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -1108,24 +981,11 @@ diff@3.2.0: resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" integrity sha512-597ykPFhtJYaXqPq6fF7Vl1fXTKgPdLOntyxpmdzUOKiYGqK7zcnbplj5088+8qJnWdzXhyeau5iVr8HVo9dgg== -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emscripten-library-decorator@~0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/emscripten-library-decorator/-/emscripten-library-decorator-0.2.2.tgz#d035f023e2a84c68305cc842cdeea38e67683c40" - integrity sha512-kDmAu7dLbBisaCGrWSNmoZPWeRyHcaJ2k5+z7IgStgZfCNYQmtADRvSic/qHvN+rf6US3HHTfrQ0/D8UdfF1CQ== - escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1178,11 +1038,6 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -1204,26 +1059,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== - -extsprintf@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" - integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - file-uri-to-path@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" @@ -1293,20 +1128,6 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -1346,30 +1167,6 @@ fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -fstream@^1.0.0, fstream@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" - integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg== - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg== - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -1380,13 +1177,6 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== - dependencies: - assert-plus "^1.0.0" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1421,7 +1211,7 @@ glob@7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.1.2, glob@^7.1.3: +glob@^7.0.0, glob@^7.1.2: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -1438,7 +1228,7 @@ globals@^9.18.0: resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.11, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -1453,19 +1243,6 @@ growl@1.9.2: resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" integrity sha512-RTBwDHhNuOx4F0hqzItc/siXCasGfC4DeWcBamclWd+6jWtBaeB/SGbMkGf0eiQoW7ib8JpvOgnUsmgMHI3Mfw== -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -1478,11 +1255,6 @@ has-flag@^1.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" integrity sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA== -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -1527,15 +1299,6 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1544,7 +1307,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1660,13 +1423,6 @@ is-finite@^1.0.0: resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -1727,11 +1483,6 @@ is-primitive@^2.0.0: resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" integrity sha512-N3w1tFaRfk3UrPfqeRyD+GYDASU3W5VinKhlORy8EWVf/sIdDL9GAcew85XmktCfH+ngG7SRXEVDoO18WMdB/Q== -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== - is-windows@^1.0.0, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -1759,11 +1510,6 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== - "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -1774,11 +1520,6 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== - jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -1789,21 +1530,6 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" - integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json3@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" @@ -1821,16 +1547,6 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - kefir@^3.7.3: version "3.8.8" resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.8.tgz#235932ddfbed422acebf5d7cba503035e9ea05c5" @@ -1998,18 +1714,6 @@ micromatch@^3.1.10: snapdragon "^0.8.1" to-regex "^3.0.2" -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -2042,7 +1746,7 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: +mkdirp@^0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== @@ -2072,7 +1776,7 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -nan@^2.12.1, nan@^2.9.2: +nan@^2.12.1: version "2.16.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== @@ -2094,40 +1798,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -nbind@^0.3.14: - version "0.3.15" - resolved "https://registry.yarnpkg.com/nbind/-/nbind-0.3.15.tgz#20c74d77d54e28627ab8268c2767f7e40aef8c53" - integrity sha512-TrKLNRj5D8wZRJb7XmUNbA1W3iTigAEpm3qaGig5bEWY/iCT2IQBgBc2EUGO59FbRIGhx5hB/McVwqxlSGScVw== - dependencies: - emscripten-library-decorator "~0.2.2" - mkdirp "~0.5.1" - nan "^2.9.2" - -node-gyp@^3.6.2: - version "3.8.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" - integrity sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA== - dependencies: - fstream "^1.0.0" - glob "^7.0.3" - graceful-fs "^4.1.2" - mkdirp "^0.5.0" - nopt "2 || 3" - npmlog "0 || 1 || 2 || 3 || 4" - osenv "0" - request "^2.87.0" - rimraf "2" - semver "~5.3.0" - tar "^2.0.0" - which "1" - -"nopt@2 || 3": - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg== - dependencies: - abbrev "1" - normalize-path@^2.0.0, normalize-path@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -2140,26 +1810,6 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -"npmlog@0 || 1 || 2 || 3 || 4": - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2208,19 +1858,11 @@ os-homedir@^1.0.0: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: +os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -osenv@0: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - output-file-sync@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" @@ -2274,11 +1916,6 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== - picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -2309,21 +1946,6 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== -psl@^1.1.28: - version "1.9.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" - integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - randomatic@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" @@ -2333,7 +1955,7 @@ randomatic@^3.0.0: kind-of "^6.0.0" math-random "^1.0.1" -readable-stream@^2.0.2, readable-stream@^2.0.6: +readable-stream@^2.0.2: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -2444,32 +2066,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.87.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -2485,28 +2081,11 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== -resolve@~1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg== - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@2: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -safe-buffer@^5.0.1, safe-buffer@^5.1.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -2519,17 +2098,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - integrity sha512-mfmm3/H9+67MCVix1h+IXTpDwL6710LyHuk7+cWC9T1mE0qz4iHhh6r4hU2wrIT9iTsAAC2XQRvfblL028cpLw== - -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== @@ -2556,11 +2125,6 @@ shebang-regex@^1.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== -signal-exit@^3.0.0: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -2631,21 +2195,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -sshpk@^1.7.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" - integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -2654,16 +2203,7 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0: +string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2679,7 +2219,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: +strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== @@ -2705,15 +2245,6 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== -tar@^2.0.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40" - integrity sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA== - dependencies: - block-stream "*" - fstream "^1.0.12" - inherits "2" - to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -2751,31 +2282,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== - union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -2799,13 +2310,6 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -2826,11 +2330,6 @@ util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - v8flags@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" @@ -2838,34 +2337,18 @@ v8flags@^2.1.1: dependencies: user-home "^1.1.1" -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== -which@1, which@^1.2.9: +which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.5" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" - integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== - dependencies: - string-width "^1.0.2 || 2 || 3 || 4" - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" -- 2.50.1.windows.1 From 64bbc3eb8461666a614d07fbf82d9c121a983372 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Tue, 22 Nov 2022 15:05:19 +0300 Subject: [PATCH 02/47] update tests --- gentest/gentest-javascript.js | 2 +- javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js | 2 +- javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js | 2 +- javascript/tests/Facebook.Yoga/YGAlignContentTest.js | 2 +- javascript/tests/Facebook.Yoga/YGAlignItemsTest.js | 2 +- javascript/tests/Facebook.Yoga/YGAlignSelfTest.js | 2 +- javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js | 2 +- javascript/tests/Facebook.Yoga/YGBorderTest.js | 2 +- javascript/tests/Facebook.Yoga/YGComputedBorderTest.js | 2 +- javascript/tests/Facebook.Yoga/YGComputedMarginTest.js | 2 +- javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js | 2 +- javascript/tests/Facebook.Yoga/YGDimensionTest.js | 2 +- javascript/tests/Facebook.Yoga/YGDirtiedTest.js | 2 +- javascript/tests/Facebook.Yoga/YGDisplayTest.js | 2 +- javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js | 2 +- javascript/tests/Facebook.Yoga/YGFlexTest.js | 2 +- javascript/tests/Facebook.Yoga/YGFlexWrapTest.js | 2 +- javascript/tests/Facebook.Yoga/YGGapTest.js | 2 +- javascript/tests/Facebook.Yoga/YGJustifyContentTest.js | 2 +- javascript/tests/Facebook.Yoga/YGMarginTest.js | 2 +- javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js | 2 +- javascript/tests/Facebook.Yoga/YGMeasureTest.js | 2 +- javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js | 2 +- javascript/tests/Facebook.Yoga/YGPaddingTest.js | 2 +- javascript/tests/Facebook.Yoga/YGPercentageTest.js | 2 +- javascript/tests/Facebook.Yoga/YGRoundingTest.js | 2 +- javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 668173cf..bee6a1d4 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -33,7 +33,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitPrologue:{value:function() { this.push([ - 'var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);', + 'var Yoga = Yoga || require("../../dist");', '' ]); }}, diff --git a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js index 26f9b853..41f77c9b 100644 --- a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js +++ b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("absolute_layout_width_height_start_top", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js index 828dbf14..39783bf3 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("align_baseline_parent_using_child_in_column_as_reference", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js index fb54f199..c07d35a7 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("align_content_flex_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js index 887c4d78..75cff235 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("align_items_stretch", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js index e1e41950..318bde12 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("align_self_center", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js index a5adc1e0..7f84876e 100644 --- a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js +++ b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("android_news_feed", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGBorderTest.js b/javascript/tests/Facebook.Yoga/YGBorderTest.js index 7b2861c0..67d32545 100644 --- a/javascript/tests/Facebook.Yoga/YGBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGBorderTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("border_no_size", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js index a80fad7f..33102621 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("border_start", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js index 8ded6d5d..2f36d0ac 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("margin_start", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js index d5571b1d..43d10b01 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("padding_start", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDimensionTest.js b/javascript/tests/Facebook.Yoga/YGDimensionTest.js index c6018771..5f9f8235 100644 --- a/javascript/tests/Facebook.Yoga/YGDimensionTest.js +++ b/javascript/tests/Facebook.Yoga/YGDimensionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("wrap_child", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js index fcfb305b..734c1c13 100644 --- a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js +++ b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("dirtied", function() { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDisplayTest.js b/javascript/tests/Facebook.Yoga/YGDisplayTest.js index d874a4ba..3b128d22 100644 --- a/javascript/tests/Facebook.Yoga/YGDisplayTest.js +++ b/javascript/tests/Facebook.Yoga/YGDisplayTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("display_none", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js index e82ee4b6..b60bb81c 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("flex_direction_column_no_height", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexTest.js b/javascript/tests/Facebook.Yoga/YGFlexTest.js index 817d604a..0bb70d92 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("flex_basis_flex_grow_column", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js index 572ea959..8dfbf0c2 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("wrap_column", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGGapTest.js b/javascript/tests/Facebook.Yoga/YGGapTest.js index 07175f74..27e4797e 100644 --- a/javascript/tests/Facebook.Yoga/YGGapTest.js +++ b/javascript/tests/Facebook.Yoga/YGGapTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("column_gap_flexible", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js index 4fc2329b..7f2bd874 100644 --- a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js +++ b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("justify_content_row_flex_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/Facebook.Yoga/YGMarginTest.js index c1d8bab3..95dd9e2b 100644 --- a/javascript/tests/Facebook.Yoga/YGMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGMarginTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("margin_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js index a14dee88..bad80bf6 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("measure_once_single_flexible_child", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/Facebook.Yoga/YGMeasureTest.js index 7b8fa8a5..34dfcfc4 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("dont_measure_single_grow_shrink_child", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js index ea7499cd..6535fcc7 100644 --- a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js +++ b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("max_width", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGPaddingTest.js b/javascript/tests/Facebook.Yoga/YGPaddingTest.js index db0488ab..25b5d04d 100644 --- a/javascript/tests/Facebook.Yoga/YGPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGPaddingTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("padding_no_size", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGPercentageTest.js b/javascript/tests/Facebook.Yoga/YGPercentageTest.js index 17129fe3..81ad74b6 100644 --- a/javascript/tests/Facebook.Yoga/YGPercentageTest.js +++ b/javascript/tests/Facebook.Yoga/YGPercentageTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("percentage_width_height", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/Facebook.Yoga/YGRoundingTest.js index 4359eede..cd82225d 100644 --- a/javascript/tests/Facebook.Yoga/YGRoundingTest.js +++ b/javascript/tests/Facebook.Yoga/YGRoundingTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("rounding_flex_basis_flex_grow_row_width_of_100", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js index e68746a3..e996f2fc 100644 --- a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js +++ b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY); +var Yoga = Yoga || require("../../dist"); it("nested_overflowing_child", function () { var config = Yoga.Config.create(); -- 2.50.1.windows.1 From 7eb187576272f8e1ae1a0088f2fa3fc0c93d747e Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Tue, 22 Nov 2022 15:05:28 +0300 Subject: [PATCH 03/47] update bench --- javascript/tests/run-bench.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index ce793ad1..283aab3d 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -21,12 +21,12 @@ let testFiles = process.argv.slice(2).map(file => { let testResults = new Map(); -for (let type of [`node`, `browser`]) { +for (let type of [`asm`]) { for (let file of testFiles) { vm.runInNewContext( file, Object.assign(Object.create(global), { - Yoga: require(`../dist/entry-${type}`), + Yoga: require('../dist'), YGBENCHMARK: function(name, fn) { let testEntry = testResults.get(name); -- 2.50.1.windows.1 From 6a5f53ed6a24d1cc88a2bf68f00304b44702efe0 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Tue, 22 Nov 2022 15:11:29 +0300 Subject: [PATCH 04/47] fix code style --- javascript/sources/Layout.hh | 1 - javascript/sources/Node.cc | 6 +++--- javascript/sources/Node.hh | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/javascript/sources/Layout.hh b/javascript/sources/Layout.hh index 1459fbe3..72380afe 100644 --- a/javascript/sources/Layout.hh +++ b/javascript/sources/Layout.hh @@ -17,4 +17,3 @@ struct Layout { double width; double height; }; - diff --git a/javascript/sources/Node.cc b/javascript/sources/Node.cc index fa6fc69f..7c71091a 100644 --- a/javascript/sources/Node.cc +++ b/javascript/sources/Node.cc @@ -242,7 +242,7 @@ int Node::getPositionType(void) const { Value Node::getPosition(int edge) const { return Value::fromYGValue( - YGNodeStyleGetPosition(m_node, static_cast(edge))); + YGNodeStyleGetPosition(m_node, static_cast(edge))); } int Node::getAlignContent(void) const { @@ -271,7 +271,7 @@ int Node::getJustifyContent(void) const { Value Node::getMargin(int edge) const { return Value::fromYGValue( - YGNodeStyleGetMargin(m_node, static_cast(edge))); + YGNodeStyleGetMargin(m_node, static_cast(edge))); } int Node::getOverflow(void) const { @@ -328,7 +328,7 @@ double Node::getBorder(int edge) const { Value Node::getPadding(int edge) const { return Value::fromYGValue( - YGNodeStyleGetPadding(m_node, static_cast(edge))); + YGNodeStyleGetPadding(m_node, static_cast(edge))); } float Node::getGap(int gutter) { diff --git a/javascript/sources/Node.hh b/javascript/sources/Node.hh index 35df0f8c..d277b1f0 100644 --- a/javascript/sources/Node.hh +++ b/javascript/sources/Node.hh @@ -157,7 +157,7 @@ public: // Style getters double getBorder(int edge) const; Value getPadding(int edge) const; - + float getGap(int gutter); public: // Tree hierarchy mutators -- 2.50.1.windows.1 From 8b6afad89d20712281db9d5f4f41eded41ecf98a Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Mon, 12 Dec 2022 12:34:53 +0300 Subject: [PATCH 05/47] fix warning with UNDEFINED_SYMBOLS --- javascript/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/javascript/Makefile b/javascript/Makefile index 74e5432a..35177bcf 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -3,7 +3,7 @@ CC=emcc all: clean dir asm asm: - $(CC) sources/yoga/*.cpp sources/*.cc \ + $(CC) sources/yoga/*.cpp sources/yoga/**/*.cpp sources/*.cc \ --bind \ -Isources \ -g0 \ @@ -18,14 +18,13 @@ asm: -s DYNAMIC_EXECUTION=0 \ -s TEXTDECODER=0 \ -s ENVIRONMENT='web' \ - -s ERROR_ON_UNDEFINED_SYMBOLS=0 \ -s FILESYSTEM=0 \ -s MALLOC="emmalloc" \ -s EXPORT_NAME="yoga" \ -o dist/asm.js clean: - rm -rf dist + rm -rf dist dir: mkdir -p dist -- 2.50.1.windows.1 From 9e77349e656bd0f6368aae5f9442752d2a9d5690 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Mon, 12 Dec 2022 12:37:54 +0300 Subject: [PATCH 06/47] fix warning about abstract non-virtual destructor --- javascript/sources/Node.hh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/javascript/sources/Node.hh b/javascript/sources/Node.hh index d277b1f0..225b1727 100644 --- a/javascript/sources/Node.hh +++ b/javascript/sources/Node.hh @@ -17,14 +17,17 @@ #include "./Value.hh" #include "./Config.hh" -struct MeasureCallback { +class MeasureCallback { +public: + virtual ~MeasureCallback() {} virtual Size measure(float width, int widthMode, float height, int heightMode) = 0; }; -struct MeasureCallbackWrapper : public emscripten::wrapper { +class MeasureCallbackWrapper : public emscripten::wrapper { +public: EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper); Size measure(float width, int widthMode, float height, int heightMode) { @@ -32,11 +35,14 @@ struct MeasureCallbackWrapper : public emscripten::wrapper { } }; -struct DirtiedCallback { +class DirtiedCallback { +public: + virtual ~DirtiedCallback() {} virtual void dirtied() = 0; }; -struct DirtiedCallbackWrapper : public emscripten::wrapper { +class DirtiedCallbackWrapper : public emscripten::wrapper { +public: EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper); void dirtied() { -- 2.50.1.windows.1 From ca8e9be31c415a9b24c92b67e7fa9394007f3cb3 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Mon, 12 Dec 2022 12:40:36 +0300 Subject: [PATCH 07/47] enable closure compiler --- javascript/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascript/Makefile b/javascript/Makefile index 35177bcf..da31b84f 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -8,9 +8,11 @@ asm: -Isources \ -g0 \ -Os \ + --closure 1 \ --memory-init-file 0 \ -s WASM=0 \ -s WASM_ASYNC_COMPILATION=0 \ + -s USE_CLOSURE_COMPILER=1 \ -s USE_ES6_IMPORT_META=0 \ -s MODULARIZE=1 \ -s ASSERTIONS=0 \ -- 2.50.1.windows.1 From 6ad64e1027b8fdce96200b6d8d898b935b7628f6 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 21 Dec 2022 23:55:08 -0800 Subject: [PATCH 08/47] Add a GitHub Workflow to validate JS bindings --- .github/actions/install-emsdk/action.yml | 22 +++++++++++++++++++ .github/actions/setup-js/action.yml | 17 +++++++++++++++ .github/actions/setup-website/action.yml | 6 +++++- .github/workflows/validate-js.yml | 27 ++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/actions/install-emsdk/action.yml create mode 100644 .github/actions/setup-js/action.yml create mode 100644 .github/workflows/validate-js.yml diff --git a/.github/actions/install-emsdk/action.yml b/.github/actions/install-emsdk/action.yml new file mode 100644 index 00000000..a2035bfd --- /dev/null +++ b/.github/actions/install-emsdk/action.yml @@ -0,0 +1,22 @@ +name: Install emsdk (including emcc) +inputs: + version: + description: EMCC Version to install + required: false + default: 3.1.28 + +runs: + using: "composite" + steps: + - name: Clone emsdk repo + working-directory: ${{ runner.temp }} + shell: bash + run: git clone https://github.com/emscripten-core/emsdk.git + + - name: emdsk install + working-directory: ${{ runner.temp }}/emsdk + shell: bash + run: | + ./emsdk install ${{ inputs.version }} + ./emsdk activate ${{ inputs.version }} + source $RUNNER_TEMP/emsdk/emsdk_env.sh diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml new file mode 100644 index 00000000..fce20c96 --- /dev/null +++ b/.github/actions/setup-js/action.yml @@ -0,0 +1,17 @@ +name: Setup JavaScript envirionment + +runs: + using: "composite" + steps: + - name: Install Node + uses: actions/setup-node@v1 + with: + node-version: 18.x + + - name: Install emsdk + uses: ./.github/actions/install-emsdk + + - name: yarn install + shell: bash + run: yarn install --frozen-lockfile + working-directory: javascript diff --git a/.github/actions/setup-website/action.yml b/.github/actions/setup-website/action.yml index d7cfe42d..0473cee3 100644 --- a/.github/actions/setup-website/action.yml +++ b/.github/actions/setup-website/action.yml @@ -3,11 +3,15 @@ name: Setup Website envirionment runs: using: "composite" steps: - - name: Install NodeJS 12 + # TODO: Update to latest when website is moved to the workspace version of + # yoga-layout + - name: Install Node uses: actions/setup-node@v1 with: node-version: 12.x + # TODO: the website should be in a yarn workspace with the library, but the + # current version of gatsby is incompatible with hoisting. - name: yarn install shell: bash run: yarn install --frozen-lockfile diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml new file mode 100644 index 00000000..da62cf4d --- /dev/null +++ b/.github/workflows/validate-js.yml @@ -0,0 +1,27 @@ +name: JavaScript + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + name: Build + Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-js + + - name: yarn build + run: yarn build + working-directory: javascript + + - name: yarn test + run: yarn test + working-directory: javascript -- 2.50.1.windows.1 From bf3af7eb90606374073e9a2a46c01c95accfebab Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 00:07:08 -0800 Subject: [PATCH 09/47] Change how we append to PATH --- .github/actions/install-emsdk/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-emsdk/action.yml b/.github/actions/install-emsdk/action.yml index a2035bfd..8f0be736 100644 --- a/.github/actions/install-emsdk/action.yml +++ b/.github/actions/install-emsdk/action.yml @@ -19,4 +19,5 @@ runs: run: | ./emsdk install ${{ inputs.version }} ./emsdk activate ${{ inputs.version }} - source $RUNNER_TEMP/emsdk/emsdk_env.sh + echo $RUNNER_TEMP/emsdk >> $GITHUB_PATH + echo $RUNNER_TEMP/emsdk/upstream/emscripten >> $GITHUB_PATH -- 2.50.1.windows.1 From b644f6186eddb1a82ca9eb81b882721594e0af18 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Thu, 22 Dec 2022 13:04:13 +0300 Subject: [PATCH 10/47] add flto flag --- javascript/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/javascript/Makefile b/javascript/Makefile index da31b84f..a6760dfb 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -8,6 +8,7 @@ asm: -Isources \ -g0 \ -Os \ + -flto \ --closure 1 \ --memory-init-file 0 \ -s WASM=0 \ -- 2.50.1.windows.1 From b92c66b467f690194d517e71ee2d64697568c277 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Thu, 22 Dec 2022 13:05:54 +0300 Subject: [PATCH 11/47] add no-rtti flag --- javascript/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/javascript/Makefile b/javascript/Makefile index a6760dfb..97f42e98 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -9,6 +9,8 @@ asm: -g0 \ -Os \ -flto \ + -fno-rtti \ + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ --closure 1 \ --memory-init-file 0 \ -s WASM=0 \ -- 2.50.1.windows.1 From 1611918fb61f91d3592dfa78cdb8d041c91d73bf Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Thu, 22 Dec 2022 13:07:22 +0300 Subject: [PATCH 12/47] specify std version --- javascript/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/javascript/Makefile b/javascript/Makefile index 97f42e98..2eb9ea79 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -8,6 +8,7 @@ asm: -Isources \ -g0 \ -Os \ + -std=c++14 \ -flto \ -fno-rtti \ -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ -- 2.50.1.windows.1 From d2effccfee0261bb99d46a3afb2df946f0c2265c Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 03:06:42 -0800 Subject: [PATCH 13/47] Update build logic --- gentest/gentest-javascript.js | 2 +- javascript/.babelrc | 13 +- javascript/Makefile | 78 +- javascript/package.json | 24 +- javascript/sources/entry.js | 2 +- javascript/sources/index.asm.js | 17 + javascript/sources/index.js | 32 - javascript/sources/index.wasm.js | 17 + .../Facebook.Yoga/YGAbsolutePositionTest.js | 2 +- .../Facebook.Yoga/YGAlignBaselineTest.js | 2 +- .../tests/Facebook.Yoga/YGAlignContentTest.js | 2 +- .../tests/Facebook.Yoga/YGAlignItemsTest.js | 2 +- .../tests/Facebook.Yoga/YGAlignSelfTest.js | 2 +- .../tests/Facebook.Yoga/YGAndroidNewsFeed.js | 2 +- .../tests/Facebook.Yoga/YGBorderTest.js | 2 +- .../Facebook.Yoga/YGComputedBorderTest.js | 2 +- .../Facebook.Yoga/YGComputedMarginTest.js | 2 +- .../Facebook.Yoga/YGComputedPaddingTest.js | 2 +- .../tests/Facebook.Yoga/YGDimensionTest.js | 2 +- .../tests/Facebook.Yoga/YGDirtiedTest.js | 2 +- .../tests/Facebook.Yoga/YGDisplayTest.js | 2 +- .../Facebook.Yoga/YGFlexDirectionTest.js | 2 +- javascript/tests/Facebook.Yoga/YGFlexTest.js | 2 +- .../tests/Facebook.Yoga/YGFlexWrapTest.js | 2 +- javascript/tests/Facebook.Yoga/YGGapTest.js | 2 +- .../Facebook.Yoga/YGJustifyContentTest.js | 2 +- .../tests/Facebook.Yoga/YGMarginTest.js | 2 +- .../tests/Facebook.Yoga/YGMeasureCacheTest.js | 2 +- .../tests/Facebook.Yoga/YGMeasureTest.js | 2 +- .../Facebook.Yoga/YGMinMaxDimensionTest.js | 2 +- .../tests/Facebook.Yoga/YGPaddingTest.js | 2 +- .../tests/Facebook.Yoga/YGPercentageTest.js | 2 +- .../tests/Facebook.Yoga/YGRoundingTest.js | 2 +- .../tests/Facebook.Yoga/YGSizeOverflowTest.js | 2 +- javascript/yarn.lock | 3016 +++++++---------- 35 files changed, 1379 insertions(+), 1874 deletions(-) create mode 100644 javascript/sources/index.asm.js delete mode 100644 javascript/sources/index.js create mode 100644 javascript/sources/index.wasm.js diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index bee6a1d4..b84c60af 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -33,7 +33,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitPrologue:{value:function() { this.push([ - 'var Yoga = Yoga || require("../../dist");', + 'var Yoga = Yoga || require("../..");', '' ]); }}, diff --git a/javascript/.babelrc b/javascript/.babelrc index d52d4dd5..2f28ae87 100644 --- a/javascript/.babelrc +++ b/javascript/.babelrc @@ -1,13 +1,8 @@ { - "presets": ["stage-3", "es2015"], + "presets": [ + ["@babel/preset-env", {"targets": "defaults"}] + ], "plugins": [ - "transform-flow-strip-types", - [ - "replace-require", - { - "fs": "{}", - "path": "{}" - } - ] + "@babel/plugin-transform-flow-strip-types" ] } diff --git a/javascript/Makefile b/javascript/Makefile index da31b84f..c0099ed7 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -1,30 +1,66 @@ -CC=emcc +CXX=em++ -all: clean dir asm +SOURCES=\ + sources/yoga/*.cpp \ + sources/yoga/**/*.cpp \ + sources/*.cc + +CXXFLAGS=\ + -Isources \ + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ + -std=c++11 \ + -g0 \ + -Os \ + -flto \ + -fno-exceptions \ + -fno-rtti \ + +EMCCFLAGS=\ + --closure 1 \ + --memory-init-file 0 \ + --no-entry + +EMCCOPTS=\ + -s ALLOW_MEMORY_GROWTH=1 \ + -s ASSERTIONS=0 \ + -s DEFAULT_TO_CXX=1 \ + -s DYNAMIC_EXECUTION=0 \ + -s ENVIRONMENT="web,node" \ + -s EXPORT_NAME="yoga" \ + -s FETCH_SUPPORT_INDEXEDDB=0 \ + -s FILESYSTEM=0 \ + -s MALLOC="emmalloc" \ + -s MODULARIZE=1 \ + -s STRICT=1 \ + -s TEXTDECODER=0 \ + -s USE_ES6_IMPORT_META=0 \ + -s WASM_ASYNC_COMPILATION=0 + +LDLIBS=\ + -lembind + +all: clean dir asm wasm asm: - $(CC) sources/yoga/*.cpp sources/yoga/**/*.cpp sources/*.cc \ - --bind \ - -Isources \ - -g0 \ - -Os \ - --closure 1 \ - --memory-init-file 0 \ + $(CXX) $(SOURCES) \ + $(INCLUDE) \ + $(CXXFLAGS) \ + $(EMCCFLAGS) \ + $(LDLIBS) \ + $(EMCCOPTS) \ -s WASM=0 \ - -s WASM_ASYNC_COMPILATION=0 \ - -s USE_CLOSURE_COMPILER=1 \ - -s USE_ES6_IMPORT_META=0 \ - -s MODULARIZE=1 \ - -s ASSERTIONS=0 \ - -s ALLOW_MEMORY_GROWTH=1 \ - -s DYNAMIC_EXECUTION=0 \ - -s TEXTDECODER=0 \ - -s ENVIRONMENT='web' \ - -s FILESYSTEM=0 \ - -s MALLOC="emmalloc" \ - -s EXPORT_NAME="yoga" \ -o dist/asm.js +wasm: + $(CXX) $(SOURCES) \ + $(INCLUDE) \ + $(CXXFLAGS) \ + $(EMCCFLAGS) \ + $(LDLIBS) \ + $(EMCCOPTS) \ + -s WASM=1 \ + -o dist/wasm.js + clean: rm -rf dist diff --git a/javascript/package.json b/javascript/package.json index d1f3e731..89813214 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -7,24 +7,28 @@ "type": "git", "url": "git@github.com:facebook/yoga.git" }, - "main": "./dist/index", + "main": "./dist/index.asm.js", + "exports": { + ".": { + "default": "./dist/index.asm.js", + "browser": "./dist/index.wasm.js", + "node": "./dist/index.wasm.js", + "react-native": "./dist/index.asm.js" + } + }, "scripts": { "is-monolithic": "test \"$(basename \"$(pwd)\")\" = javascript", "copy-sources": "! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)", "build": "npm run copy-sources && make && npm run build:js", "test": "time mocha --expose-gc -r tests/tools.js tests/Facebook.Yoga/**/*.js", "benchmark": "npm run build && node tests/run-bench $(find tests/Benchmarks -name '*.js')", - "build:js": "babel sources --out-dir dist && flow-copy-source sources dist" + "build:js": "babel sources --source-maps --out-dir dist && flow-copy-source sources dist" }, - "dependencies": {}, "devDependencies": { - "babel-cli": "^6.24.1", - "babel-core": "^6.25.0", - "babel-plugin-replace-require": "^0.0.4", - "babel-plugin-transform-flow-strip-types": "^6.22.0", - "babel-preset-es2015": "^6.24.1", - "babel-preset-stage-3": "^6.24.1", - "cross-env": "^4.0.0", + "@babel/cli": "^7.20.7", + "@babel/core":"^7.20.7", + "@babel/plugin-transform-flow-strip-types": "^7.19.0", + "@babel/preset-env": "^7.20.2", "flow-copy-source": "^2.0.7", "mocha": "^3.2.0" } diff --git a/javascript/sources/entry.js b/javascript/sources/entry.js index d7b6f419..cbc61c69 100644 --- a/javascript/sources/entry.js +++ b/javascript/sources/entry.js @@ -15,7 +15,7 @@ import type { Yoga$Wrap, Yoga$Align, Yoga$FlexDirection, - Yoga$Gap, + Yoga$Gutter, Yoga$Direction, Yoga$PositionType, Yoga$Overflow, diff --git a/javascript/sources/index.asm.js b/javascript/sources/index.asm.js new file mode 100644 index 00000000..6b6eff65 --- /dev/null +++ b/javascript/sources/index.asm.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +const entry = require('./entry'); +const yoga = require('./asm'); + +module.exports = entry(yoga()); + +export type * from './YGEnums.js'; +export type * from './entry'; diff --git a/javascript/sources/index.js b/javascript/sources/index.js deleted file mode 100644 index 6f361604..00000000 --- a/javascript/sources/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -const entry = require('./entry'); -const yoga = require('./asm'); - -// $FlowFixMe ret will not be null here -module.exports = entry(yoga()); - -export type { - Yoga$Justify, - Yoga$Align, - Yoga$FlexDirection, - Yoga$Direction, - Yoga$Wrap, - Yoga$Gutter, - Yoga$Edge, - Yoga$Display, - Yoga$Unit, - Yoga$Overflow, - Yoga$PositionType, - Yoga$ExperimentalFeature, -} from './YGEnums.js'; - -export type {Yoga$Node, Yoga$Config} from './entry'; diff --git a/javascript/sources/index.wasm.js b/javascript/sources/index.wasm.js new file mode 100644 index 00000000..19f00053 --- /dev/null +++ b/javascript/sources/index.wasm.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +const entry = require('./entry'); +const yoga = require('./wasm'); + +module.exports = entry(yoga()); + +export type * from './YGEnums.js'; +export type * from './entry'; diff --git a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js index 41f77c9b..3c671c83 100644 --- a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js +++ b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("absolute_layout_width_height_start_top", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js index 39783bf3..84a8df09 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("align_baseline_parent_using_child_in_column_as_reference", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js index c07d35a7..8e132fb9 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("align_content_flex_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js index 75cff235..b8867511 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("align_items_stretch", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js index 318bde12..ca44dbe2 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("align_self_center", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js index 7f84876e..02f1410c 100644 --- a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js +++ b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("android_news_feed", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGBorderTest.js b/javascript/tests/Facebook.Yoga/YGBorderTest.js index 67d32545..fa9a4359 100644 --- a/javascript/tests/Facebook.Yoga/YGBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGBorderTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("border_no_size", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js index 33102621..8d080f8c 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("border_start", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js index 2f36d0ac..d31b36a9 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("margin_start", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js index 43d10b01..f083be5f 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("padding_start", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDimensionTest.js b/javascript/tests/Facebook.Yoga/YGDimensionTest.js index 5f9f8235..aee5b110 100644 --- a/javascript/tests/Facebook.Yoga/YGDimensionTest.js +++ b/javascript/tests/Facebook.Yoga/YGDimensionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("wrap_child", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js index 734c1c13..9c443535 100644 --- a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js +++ b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("dirtied", function() { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDisplayTest.js b/javascript/tests/Facebook.Yoga/YGDisplayTest.js index 3b128d22..eab71283 100644 --- a/javascript/tests/Facebook.Yoga/YGDisplayTest.js +++ b/javascript/tests/Facebook.Yoga/YGDisplayTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("display_none", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js index b60bb81c..c6fa02b8 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("flex_direction_column_no_height", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexTest.js b/javascript/tests/Facebook.Yoga/YGFlexTest.js index 0bb70d92..d34f7914 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("flex_basis_flex_grow_column", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js index 8dfbf0c2..d1760de9 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("wrap_column", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGGapTest.js b/javascript/tests/Facebook.Yoga/YGGapTest.js index 27e4797e..4fa6f019 100644 --- a/javascript/tests/Facebook.Yoga/YGGapTest.js +++ b/javascript/tests/Facebook.Yoga/YGGapTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("column_gap_flexible", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js index 7f2bd874..276d05c3 100644 --- a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js +++ b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("justify_content_row_flex_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/Facebook.Yoga/YGMarginTest.js index 95dd9e2b..6dab9ef3 100644 --- a/javascript/tests/Facebook.Yoga/YGMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGMarginTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("margin_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js index bad80bf6..d1703792 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("measure_once_single_flexible_child", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/Facebook.Yoga/YGMeasureTest.js index 34dfcfc4..c72aa46a 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureTest.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("dont_measure_single_grow_shrink_child", function () { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js index 6535fcc7..75e256de 100644 --- a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js +++ b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("max_width", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGPaddingTest.js b/javascript/tests/Facebook.Yoga/YGPaddingTest.js index 25b5d04d..f08ea7aa 100644 --- a/javascript/tests/Facebook.Yoga/YGPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGPaddingTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("padding_no_size", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGPercentageTest.js b/javascript/tests/Facebook.Yoga/YGPercentageTest.js index 81ad74b6..1d8745a5 100644 --- a/javascript/tests/Facebook.Yoga/YGPercentageTest.js +++ b/javascript/tests/Facebook.Yoga/YGPercentageTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("percentage_width_height", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/Facebook.Yoga/YGRoundingTest.js index cd82225d..222d6b39 100644 --- a/javascript/tests/Facebook.Yoga/YGRoundingTest.js +++ b/javascript/tests/Facebook.Yoga/YGRoundingTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("rounding_flex_basis_flex_grow_row_width_of_100", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js index e996f2fc..2f0d8ef9 100644 --- a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js +++ b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -var Yoga = Yoga || require("../../dist"); +var Yoga = Yoga || require("../.."); it("nested_overflowing_child", function () { var config = Yoga.Config.create(); diff --git a/javascript/yarn.lock b/javascript/yarn.lock index c79ab1d4..9f8e6ad3 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -2,20 +2,994 @@ # yarn lockfile v1 -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== +"@ampproject/remapping@^2.1.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" + integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + dependencies: + "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/cli@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.20.7.tgz#8fc12e85c744a1a617680eacb488fab1fcd35b7c" + integrity sha512-WylgcELHB66WwQqItxNILsMlaTd8/SO6SgTTjMp4uCI7P4QyH1r3nqgFmO3BfM4AtfniHgFMH3EpYFj/zynBkQ== + dependencies: + "@jridgewell/trace-mapping" "^0.3.8" + commander "^4.0.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.1.0" + glob "^7.2.0" + make-dir "^2.1.0" + slash "^2.0.0" + optionalDependencies: + "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" + chokidar "^3.4.0" + +"@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.1", "@babel/compat-data@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733" + integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g== + +"@babel/core@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f" + integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.7" + "@babel/helpers" "^7.20.7" + "@babel/parser" "^7.20.7" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/generator@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" + integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== + dependencies: + "@babel/types" "^7.20.7" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" + integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" + integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== + dependencies: + "@babel/helper-explode-assignable-expression" "^7.18.6" + "@babel/types" "^7.18.9" + +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.0", "@babel/helper-compilation-targets@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" + integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" + lru-cache "^5.1.1" + semver "^6.3.0" + +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.5", "@babel/helper-create-class-features-plugin@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.7.tgz#d0e1f8d7e4ed5dac0389364d9c0c191d948ade6f" + integrity sha512-LtoWbDXOaidEf50hmdDqn9g8VEzsorMexoWMQdQODbvmqYmaF23pBP5VNPAGIFHsFQCIeKokDiz3CH5Y2jlY6w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-split-export-declaration" "^7.18.6" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" + integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + regexpu-core "^5.2.1" + +"@babel/helper-define-polyfill-provider@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" + integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== + dependencies: + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + semver "^6.1.2" + +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== + +"@babel/helper-explode-assignable-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" + integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== + dependencies: + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-member-expression-to-functions@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz#a6f26e919582275a93c3aa6594756d71b0bb7f05" + integrity sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw== + dependencies: + "@babel/types" "^7.20.7" + +"@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.7.tgz#7a6c9a1155bef55e914af574153069c9d9470c43" + integrity sha512-FNdu7r67fqMUSVuQpFQGE6BPdhJIhitoxhGzDbAXNcA07uoVG37fOiMk3OSV8rEICuyG6t8LGkd9EE64qIEoIA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/helper-optimise-call-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" + integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + +"@babel/helper-remap-async-to-generator@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" + integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-wrap-function" "^7.18.9" + "@babel/types" "^7.18.9" + +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" + integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== + dependencies: + "@babel/types" "^7.20.2" + +"@babel/helper-skip-transparent-expression-wrappers@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" + integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== + dependencies: + "@babel/types" "^7.20.0" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + +"@babel/helper-wrap-function@^7.18.9": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" + integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== + dependencies: + "@babel/helper-function-name" "^7.19.0" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.5" + "@babel/types" "^7.20.5" + +"@babel/helpers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.7.tgz#04502ff0feecc9f20ecfaad120a18f011a8e6dce" + integrity sha512-PBPjs5BppzsGaxHQCDKnZ6Gd9s6xl8bBCluz3vEInLGRJmnZan4F6BYCeqtyXqkk4W5IlPmjK4JlOuZkpJ3xZA== + dependencies: + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" + integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" + integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1" + integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/plugin-proposal-optional-chaining" "^7.20.7" + +"@babel/plugin-proposal-async-generator-functions@^7.20.1": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" + integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-proposal-class-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" + integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-class-static-block@^7.18.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz#92592e9029b13b15be0f7ce6a7aedc2879ca45a7" + integrity sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-proposal-dynamic-import@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" + integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + +"@babel/plugin-proposal-export-namespace-from@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" + integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + +"@babel/plugin-proposal-json-strings@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" + integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-json-strings" "^7.8.3" + +"@babel/plugin-proposal-logical-assignment-operators@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" + integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" + integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + +"@babel/plugin-proposal-numeric-separator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" + integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-proposal-object-rest-spread@^7.20.2": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" + integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.20.7" + +"@babel/plugin-proposal-optional-catch-binding@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" + integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz#49f2b372519ab31728cc14115bb0998b15bfda55" + integrity sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-proposal-private-methods@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" + integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-private-property-in-object@^7.18.6": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135" + integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" + integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-dynamic-import@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-export-namespace-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + +"@babel/plugin-syntax-flow@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.18.6.tgz#774d825256f2379d06139be0c723c4dd444f3ca1" + integrity sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-syntax-import-assertions@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" + integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-transform-arrow-functions@^7.18.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" + integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-async-to-generator@^7.18.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354" + integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== + dependencies: + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + +"@babel/plugin-transform-block-scoped-functions@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" + integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-block-scoping@^7.20.2": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.7.tgz#5cc9cc3f3976de7f632d3f20eab3abee299ed36e" + integrity sha512-C1njwSKnumUgtgc4j1LAWR48PkfwfHHRd8bWyolSCLShKnqA52VX1+B+GZhJteQlwZeSqYddCQh9Str816Jxtw== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-classes@^7.20.2": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz#f438216f094f6bb31dc266ebfab8ff05aecad073" + integrity sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-split-export-declaration" "^7.18.6" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa" + integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/template" "^7.20.7" + +"@babel/plugin-transform-destructuring@^7.20.2": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz#8bda578f71620c7de7c93af590154ba331415454" + integrity sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" + integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-duplicate-keys@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" + integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-exponentiation-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" + integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-flow-strip-types@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.19.0.tgz#e9e8606633287488216028719638cbbb2f2dde8f" + integrity sha512-sgeMlNaQVbCSpgLSKP4ZZKfsJVnFnNQlUSk6gPYzR/q7tzCgQF2t8RBKAP6cKJeZdveei7Q7Jm527xepI8lNLg== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/plugin-syntax-flow" "^7.18.6" + +"@babel/plugin-transform-for-of@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" + integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-function-name@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" + integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== + dependencies: + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" + integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-member-expression-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" + integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-modules-amd@^7.19.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.7.tgz#1e5cfeb4e5f9b392e86f85698896336b442f8760" + integrity sha512-+1IVLD+dHOzRZWNFFSoyPZz4ffsVmOP+OhhjeahLKpU97v/52LcCb9RabRl5eHM1/HAuH5Dl0q9Pyzrq1v2otQ== + dependencies: + "@babel/helper-module-transforms" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-modules-commonjs@^7.19.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.7.tgz#abb5f84695e74d46acf48244082f6cbf8bb23120" + integrity sha512-76jqqFiFdCD+RJwEdtBHUG2/rEKQAmpejPbAKyQECEE3/y4U5CMPc9IXvipS990vgQhzq+ZRw6WJ+q4xJ/P24w== + dependencies: + "@babel/helper-module-transforms" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-simple-access" "^7.20.2" + +"@babel/plugin-transform-modules-systemjs@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.6.tgz#59e2a84064b5736a4471b1aa7b13d4431d327e0d" + integrity sha512-fqGLBepcc3kErfR9R3DnVpURmckXP7gj7bAlrTQyBxrigFqszZCkFkcoxzCp2v32XmwXLvbw+8Yq9/b+QqksjQ== + dependencies: + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-module-transforms" "^7.19.6" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-validator-identifier" "^7.19.1" + +"@babel/plugin-transform-modules-umd@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" + integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== + dependencies: + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.19.1": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" + integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-new-target@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" + integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-object-super@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" + integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-replace-supers" "^7.18.6" + +"@babel/plugin-transform-parameters@^7.20.1", "@babel/plugin-transform-parameters@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz#0ee349e9d1bc96e78e3b37a7af423a4078a7083f" + integrity sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-property-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" + integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-regenerator@^7.18.6": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" + integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + regenerator-transform "^0.15.1" + +"@babel/plugin-transform-reserved-words@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" + integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-shorthand-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" + integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-spread@^7.19.0": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e" + integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + +"@babel/plugin-transform-sticky-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" + integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-template-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" + integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-typeof-symbol@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" + integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-unicode-escapes@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" + integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-unicode-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" + integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/preset-env@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.20.2.tgz#9b1642aa47bb9f43a86f9630011780dab7f86506" + integrity sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg== + dependencies: + "@babel/compat-data" "^7.20.1" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-validator-option" "^7.18.6" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" + "@babel/plugin-proposal-async-generator-functions" "^7.20.1" + "@babel/plugin-proposal-class-properties" "^7.18.6" + "@babel/plugin-proposal-class-static-block" "^7.18.6" + "@babel/plugin-proposal-dynamic-import" "^7.18.6" + "@babel/plugin-proposal-export-namespace-from" "^7.18.9" + "@babel/plugin-proposal-json-strings" "^7.18.6" + "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" + "@babel/plugin-proposal-numeric-separator" "^7.18.6" + "@babel/plugin-proposal-object-rest-spread" "^7.20.2" + "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" + "@babel/plugin-proposal-optional-chaining" "^7.18.9" + "@babel/plugin-proposal-private-methods" "^7.18.6" + "@babel/plugin-proposal-private-property-in-object" "^7.18.6" + "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-syntax-import-assertions" "^7.20.0" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-transform-arrow-functions" "^7.18.6" + "@babel/plugin-transform-async-to-generator" "^7.18.6" + "@babel/plugin-transform-block-scoped-functions" "^7.18.6" + "@babel/plugin-transform-block-scoping" "^7.20.2" + "@babel/plugin-transform-classes" "^7.20.2" + "@babel/plugin-transform-computed-properties" "^7.18.9" + "@babel/plugin-transform-destructuring" "^7.20.2" + "@babel/plugin-transform-dotall-regex" "^7.18.6" + "@babel/plugin-transform-duplicate-keys" "^7.18.9" + "@babel/plugin-transform-exponentiation-operator" "^7.18.6" + "@babel/plugin-transform-for-of" "^7.18.8" + "@babel/plugin-transform-function-name" "^7.18.9" + "@babel/plugin-transform-literals" "^7.18.9" + "@babel/plugin-transform-member-expression-literals" "^7.18.6" + "@babel/plugin-transform-modules-amd" "^7.19.6" + "@babel/plugin-transform-modules-commonjs" "^7.19.6" + "@babel/plugin-transform-modules-systemjs" "^7.19.6" + "@babel/plugin-transform-modules-umd" "^7.18.6" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1" + "@babel/plugin-transform-new-target" "^7.18.6" + "@babel/plugin-transform-object-super" "^7.18.6" + "@babel/plugin-transform-parameters" "^7.20.1" + "@babel/plugin-transform-property-literals" "^7.18.6" + "@babel/plugin-transform-regenerator" "^7.18.6" + "@babel/plugin-transform-reserved-words" "^7.18.6" + "@babel/plugin-transform-shorthand-properties" "^7.18.6" + "@babel/plugin-transform-spread" "^7.19.0" + "@babel/plugin-transform-sticky-regex" "^7.18.6" + "@babel/plugin-transform-template-literals" "^7.18.9" + "@babel/plugin-transform-typeof-symbol" "^7.18.9" + "@babel/plugin-transform-unicode-escapes" "^7.18.10" + "@babel/plugin-transform-unicode-regex" "^7.18.6" + "@babel/preset-modules" "^0.1.5" + "@babel/types" "^7.20.2" + babel-plugin-polyfill-corejs2 "^0.3.3" + babel-plugin-polyfill-corejs3 "^0.6.0" + babel-plugin-polyfill-regenerator "^0.4.1" + core-js-compat "^3.25.1" + semver "^6.3.0" + +"@babel/preset-modules@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" + integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/types" "^7.4.4" + esutils "^2.0.2" + +"@babel/runtime@^7.8.4": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd" + integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ== + dependencies: + regenerator-runtime "^0.13.11" + +"@babel/template@^7.18.10", "@babel/template@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.7.tgz#114f992fa989a390896ea72db5220780edab509c" + integrity sha512-xueOL5+ZKX2dJbg8z8o4f4uTRTqGDRjilva9D1hiRlayJbTY8jBRL+Ph67IeRTIE439/VifHk+Z4g0SwRtQE0A== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.4.4": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" + integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + +"@jridgewell/gen-mapping@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" + integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== + dependencies: + "@jridgewell/set-array" "^1.0.0" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + +"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3": + version "2.1.8-no-fsevents.3" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" + integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" ansi-styles@^4.0.0: version "4.3.0" @@ -24,14 +998,6 @@ ansi-styles@^4.0.0: dependencies: color-convert "^2.0.1" -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -40,682 +1006,40 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha512-dtXTVMkh6VkEEA7OhXnN1Ecb8aAGFdZ1LFxtOCoqj4qkyOJMt7+qs6Ahdy6p/NQCPYsRSXXivhSB/J5E9jmYKA== +babel-plugin-polyfill-corejs2@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" + integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== dependencies: - arr-flatten "^1.0.1" + "@babel/compat-data" "^7.17.7" + "@babel/helper-define-polyfill-provider" "^0.3.3" + semver "^6.1.1" -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha512-G2n5bG5fSUCpnsXz4+8FUkYsGPkNfLn9YvS66U5qbTIXI2Ynnlo4Bi42bWv+omKUCqz+ejzfClwne0alJWJPhg== - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== - -async-each@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -babel-cli@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - integrity sha512-wau+BDtQfuSBGQ9PzzFL3REvR9Sxnd4LKwtcHAiPjhugA7K/80vpHXafj+O5bAqJOuSefjOx5ZJnNSR2J1Qw6Q== +babel-plugin-polyfill-corejs3@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" + integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" + "@babel/helper-define-polyfill-provider" "^0.3.3" + core-js-compat "^3.25.1" -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g== +babel-plugin-polyfill-regenerator@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" + integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-core@^6.25.0, babel-core@^6.26.0: - version "6.26.3" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" - integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== - dependencies: - babel-code-frame "^6.26.0" - babel-generator "^6.26.0" - babel-helpers "^6.24.1" - babel-messages "^6.23.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - convert-source-map "^1.5.1" - debug "^2.6.9" - json5 "^0.5.1" - lodash "^4.17.4" - minimatch "^3.0.4" - path-is-absolute "^1.0.1" - private "^0.1.8" - slash "^1.0.0" - source-map "^0.5.7" - -babel-generator@^6.26.0: - version "6.26.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" - integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.17.4" - source-map "^0.5.7" - trim-right "^1.0.1" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - integrity sha512-gCtfYORSG1fUMX4kKraymq607FWgMWg+j42IFPc18kFQEsmtaibP4UrqsXt8FlEJle25HUd4tsoDR7H2wDhe9Q== - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - integrity sha512-RL8n2NiEj+kKztlrVJM9JT1cXzzAdvWFh76xh/H1I4nKwunzE4INBXn8ieCZ+wh4zWszZk7NBS1s/8HR5jDkzQ== - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - integrity sha512-bHkmjcC9lM1kmZcVpA5t2om2nzT/xiZpo6TJq7UlZ3wqKfzia4veeXbIhKvJXAMzhhEBd3cR1IElL5AenWEUpA== - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - integrity sha512-qe5csbhbvq6ccry9G7tkXbzNtcDiH4r51rrPUbwwoTzZ18AqxWYRZT6AOmxrpxKnQBW0pYlBI/8vh73Z//78nQ== - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - integrity sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q== - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - integrity sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng== - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - integrity sha512-zAYl3tqerLItvG5cKYw7f1SpvIxS9zi7ohyGHaI9cgDUjAT6YcY9jIEH5CstetP5wHIVSceXwNS7Z5BpJg+rOw== - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - integrity sha512-Op9IhEaxhbRT8MDXx2iNuMgciu2V8lDvYCNQbDGjdBNCjaMvyLf4wl4A3b8IgndCyQF8TwfgsQ8T3VD8aX1/pA== - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - integrity sha512-VlPiWmqmGJp0x0oK27Out1D+71nVVCTSdlbhIVoaBAj2lUgrNjBCRR9+llO4lTSb2O4r7PJg+RobRkhBrf6ofg== - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - integrity sha512-RYqaPD0mQyQIFRu7Ho5wE2yvA/5jxqCIj/Lv4BXNq23mHYu/vxikOy2JueLiBxQknwapwrJeNCesvY0ZcfnlHg== - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - integrity sha512-sLI+u7sXJh6+ToqDr57Bv973kCepItDhMou0xCP2YPVmR1jkHSCY+p1no8xErbV1Siz5QE8qKT1WIwybSWlqjw== - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helpers@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" - integrity sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ== - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - integrity sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - integrity sha512-B1M5KBP29248dViEo1owyY32lk1ZSH2DaNNrXLGt8lyjjHm7pBqAdQ7VKUPR6EEDO323+OvT3MQXbCin8ooWdA== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-replace-require@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/babel-plugin-replace-require/-/babel-plugin-replace-require-0.0.4.tgz#2afe99c8cfd1a9faf5fa2a807bdb35c30a4970f8" - integrity sha512-d9P6UT7ffqRfuM8Kaec4YMpC1XyQE8bbRgM2OsMNZO5xwE2OzmKIDg3qajjOG2iInMQSOQDXviyDYZx8hYf5Nw== - dependencies: - babylon "^6.14.1" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" - integrity sha512-4Zp4unmHgw30A1eWI5EpACji2qMocisdXhAftfhXoSV9j0Tvj6nRFE3tOmRY912E0FMRm/L5xWE7MGVT2FoLnw== - -babel-plugin-syntax-async-generators@^6.5.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - integrity sha512-EbciFN5Jb9iqU9bqaLmmFLx2G8pAUsvpWJ6OzOWBNrSY9qTohXj+7YfZx6Ug1Qqh7tCb1EA7Jvn9bMC1HBiucg== - -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" - integrity sha512-Z/flU+T9ta0aIEKl1tGEmN/pZiI1uXmCiGFRegKacQfEJzp7iNsKloZmyJlQr+75FCJtiFfGIK03SiCvCt9cPQ== - -babel-plugin-syntax-flow@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" - integrity sha512-HbTDIoG1A1op7Tl/wIFQPULIBA61tsJ8Ntq2FAhLwuijrzosM/92kAfgU1Q3Kc7DH/cprJg5vDfuTY4QUL4rDA== - -babel-plugin-syntax-object-rest-spread@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha512-C4Aq+GaAj83pRQ0EFgTvw5YO6T3Qz2KGrNRwIj9mSoNHVvdZY4KO2uA6HNtNXCw993iSZnckY1aLW8nOi8i4+w== - -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" - integrity sha512-Gx9CH3Q/3GKbhs07Bszw5fPTlU+ygrOGfAhEt7W2JICwufpC4SuO0mG0+4NykPBSYPMJhqvVlDBU17qB1D+hMQ== - -babel-plugin-transform-async-generator-functions@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" - integrity sha512-uT7eovUxtXe8Q2ufcjRuJIOL0hg6VAUJhiWJBLxH/evYAw+aqoJLcYTR8hqx13iOx/FfbCMHgBmXWZjukbkyPg== - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-async-to-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - integrity sha512-7BgYJujNCg0Ti3x0c/DL3tStvnKS6ktIYOmo9wginv/dfZOrbSZ+qG4IRRHMBOzZ5Awb1skTiAsQXg/+IWkZYw== - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - integrity sha512-PCqwwzODXW7JMrzu+yZIaYbPQSKjDTAsNNlK2l5Gg9g4rz2VzLnZsStvp/3c46GfXpwkyufb3NCyG9+50FF1Vg== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - integrity sha512-2+ujAT2UMBzYFm7tidUsYh+ZoIutxJ3pN9IYrF1/H6dCKtECfhmB8UkHVpyxDwkj0CYbQG35ykoz925TUnBc3A== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-block-scoping@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - integrity sha512-YiN6sFAQ5lML8JjCmr7uerS5Yc/EMbgg9G8ZNmk2E3nYX4ckHR01wrkeeMijEf5WHNK5TW0Sl0Uu3pv3EdOJWw== - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - integrity sha512-5Dy7ZbRinGrNtmWpquZKZ3EGY8sDgIVB4CU8Om8q8tnMLrD/m94cKglVcHps0BCTdZ0TJeeAWOq2TK9MIY6cag== - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - integrity sha512-C/uAv4ktFP/Hmh01gMTvYvICrKze0XVX9f2PdIXuriCSvUmV9j+u+BB9f5fJK3+878yMK6dkdcq+Ymr9mrcLzw== - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-destructuring@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" - integrity sha512-aNv/GDAW0j/f4Uy1OEPZn1mqD+Nfy9viFGBfQ5bZyT35YqOiqx7/tXdyfZkJ1sC21NyEsBdfDY6PYmLHF4r5iA== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" - integrity sha512-ossocTuPOssfxO2h+Z3/Ea1Vo1wWx31Uqy9vIiJusOP4TbF7tPs9U0sJ9pX9OJPf4lXRGj5+6Gkl/HHKiAP5ug== - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-for-of@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" - integrity sha512-DLuRwoygCoXx+YfxHLkVx5/NpeSbVwfoTeBykpJK7JhYWlL/O8hgAK/reforUnZDlxasOrVPPJVI/guE3dCwkw== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-function-name@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" - integrity sha512-iFp5KIcorf11iBqu/y/a7DK3MN5di3pNCzto61FqCNnUX4qeBwcV1SLqe10oXNnCaxBUImX3SckX2/o1nsrTcg== - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - integrity sha512-tjFl0cwMPpDYyoqYA9li1/7mGFit39XiNX5DKC/uCNjBctMxyL1/PT/l4rSlbvBG1pOKI88STRdUsWXB3/Q9hQ== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" - integrity sha512-LnIIdGWIKdw7zwckqx+eGjcS8/cl8D74A3BpJbGjKTFFNJSMrjN4bIh22HY1AlkUbeLG6X6OZj56BDvWD+OeFA== - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - integrity sha512-ONFIPsq8y4bls5PPsAWYXH/21Hqv64TBxdje0FvU3MhIV6QM2j5YS7KvAzg/nTIVLot2D2fmFQrFWCbgHlFEjg== - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-modules-umd@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - integrity sha512-LpVbiT9CLsuAIp3IG0tfbVo81QIhn6pE8xBJ7XSeCtFlMltuar5VuBV6y6Q45tpui9QWcy5i0vLQfCfrnF7Kiw== - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - -babel-plugin-transform-es2015-object-super@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" - integrity sha512-8G5hpZMecb53vpD3mjs64NhI1au24TAmokQ4B+TBFBjN9cVoGoOvotdrMMRmHvVZUEvqGUPWL514woru1ChZMA== - dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-parameters@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - integrity sha512-8HxlW+BB5HqniD+nLkQ4xSAVq3bR/pcYW9IigY+2y0dI+Y7INFeTbfAQr+63T3E4UDsZGjyb+l9txUnABWxlOQ== - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" - integrity sha512-mDdocSfUVm1/7Jw/FIRNw9vPrBQNePy6wZJlR8HAUBLybNp1w/6lr6zZ2pjMShee65t/ybR5pT8ulkLzD1xwiw== - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - integrity sha512-3Ghhi26r4l3d0Js933E5+IhHwk0A1yiutj9gwvzmFbVV0sPMYk2lekhOufHBswX7NCoSeF4Xrl3sCIuSIa+zOg== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-sticky-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - integrity sha512-CYP359ADryTo3pCsH0oxRo/0yn6UsEZLqYohHmvLQdfS9xkf+MbCzE3/Kolw9OYIY4ZMilH25z/5CbQbwDD+lQ== - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - integrity sha512-x8b9W0ngnKzDMHimVtTfn5ryimars1ByTqsfBDwAqLibmuuQY6pgBQi5z1ErIsUOWBdw1bW9FSz5RZUojM4apg== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - integrity sha512-fz6J2Sf4gYN6gWgRZaoFXmq93X+Li/8vf+fb0sGDVtdeWvxC9y5/bTD7bvfWMEq6zetGEHpWjtzRGSugt5kNqw== - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-transform-es2015-unicode-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" - integrity sha512-v61Dbbihf5XxnYjtBN04B/JBvsScY37R1cZT5r9permN1cp+b70DY3Ib3fIkgn1DI9U3tGgBJZVD8p/mE/4JbQ== - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - integrity sha512-LzXDmbMkklvNhprr20//RStKVcT8Cu+SQtX18eMHLhjHf2yFzwtQ0S2f0jQ+89rokoNdmwoSqYzAhq86FxlLSQ== - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-flow-strip-types@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" - integrity sha512-TxIM0ZWNw9oYsoTthL3lvAK3+eTujzktoXJg4ubGvICGbVuXVYv5hHv0XXpz8fbqlJaGYY4q5SVzaSmsg3t4Fg== - dependencies: - babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.22.0" - -babel-plugin-transform-object-rest-spread@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha512-ocgA9VJvyxwt+qJB0ncxV8kb/CjfTcECUY4tQ5VT7nP6Aohzobm8CDFaQ5FHdvZQzLmf0sgDxB8iRXZXxwZcyA== - dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.26.0" - -babel-plugin-transform-regenerator@^6.24.1: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - integrity sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg== - dependencies: - regenerator-transform "^0.10.0" - -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - integrity sha512-j3KtSpjyLSJxNoCDrhwiJad8kw0gJ9REGj8/CqL0HeRyLnvUNYV9zcqluL6QJSXh3nfsLEmSLvwRfGzrgR96Pw== - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-polyfill@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - integrity sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ== - dependencies: - babel-runtime "^6.26.0" - core-js "^2.5.0" - regenerator-runtime "^0.10.5" - -babel-preset-es2015@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" - integrity sha512-XfwUqG1Ry6R43m4Wfob+vHbIVBIqTg/TJY4Snku1iIzeH7mUnwHA8Vagmv+ZQbPwhS8HgsdQvy28Py3k5zpoFQ== - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" - -babel-preset-stage-3@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" - integrity sha512-eCbEOF8uN0KypFXJmZXn2sTk7bPV9uM5xov7G/7BM08TbQEObsVs0cEWfy6NQySlfk7JBi/t+XJP1JkruYfthA== - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-generator-functions "^6.24.1" - babel-plugin-transform-async-to-generator "^6.24.1" - babel-plugin-transform-exponentiation-operator "^6.24.1" - babel-plugin-transform-object-rest-spread "^6.22.0" - -babel-register@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" - integrity sha512-veliHlHX06wjaeY8xNITbveXSiI+ASFnOqvne/LaIJIqOWi2Ogmj91KOugEz/hoh/fwMhXNBJPCv8Xaz5CyM4A== - dependencies: - babel-core "^6.26.0" - babel-runtime "^6.26.0" - core-js "^2.5.0" - home-or-tmp "^2.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - source-map-support "^0.4.15" - -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - integrity sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg== - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - integrity sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA== - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - integrity sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g== - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" - -babylon@^6.14.1, babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + "@babel/helper-define-polyfill-provider" "^0.3.3" balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -724,31 +1048,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha512-xU7bpz2ytJl1bH9cgIurjpg/n8Gohy9GTw81heDYLJQ4RU60dlyJsa+atVF2pI0yMMvKxI9HkKwjePCj5XI1hw== - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -761,54 +1060,36 @@ browser-stdout@1.3.0: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" integrity sha512-7Rfk377tpSM9TWBEeHs0FlDZGoAIei2V/4MdZJoFMBFAK6BqLpxAIUepGRHGdPFgGsLb02PXovC4qddyHvQqTg== -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== +browserslist@^4.21.3, browserslist@^4.21.4: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" + node-releases "^2.0.6" + update-browserslist-db "^1.0.9" camelcase@^5.0.0: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" +caniuse-lite@^1.0.30001400: + version "1.0.30001441" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" + integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg== -chokidar@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha512-mk8fAWcRUOxY7btlLtitj3A45jOwSAxH4tOFOoEGbVsl6cL6pPMWUy7dwZ/canfj3QEdP6FHSnf/l1c6/WkzVg== +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" -chokidar@^3.0.0: +chokidar@^3.0.0, chokidar@^3.4.0: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -823,16 +1104,6 @@ chokidar@^3.0.0: optionalDependencies: fsevents "~2.3.2" -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -842,13 +1113,12 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" + color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" @@ -857,6 +1127,11 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -869,59 +1144,27 @@ commander@2.9.0: dependencies: graceful-readlink ">= 1.0.0" -commander@^2.11.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== +commander@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -convert-source-map@^1.5.0, convert-source-map@^1.5.1: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== +convert-source-map@^1.1.0, convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + +core-js-compat@^3.25.1: + version "3.26.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.1.tgz#0e710b09ebf689d719545ac36e49041850f943df" + integrity sha512-622/KzTudvXCDLRw70iHW4KKs1aGpcRcowGWyYJr2DEBfRrd6hNJybxSWJFuZYD4ma86xhrwDDHxmDaIq4EA8A== dependencies: - safe-buffer "~5.1.1" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== - -core-js@^2.4.0, core-js@^2.5.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cross-env@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-4.0.0.tgz#16083862d08275a4628b0b243b121bedaa55dd80" - integrity sha512-dofkcyPqOy/AR14nbYSpk+TZ4IJZqg2as+/mQNkzh+7Xba2I1I1eyg/1G2dtSpD2LHjcEWwnGquiH2OP5LoeOw== - dependencies: - cross-spawn "^5.1.0" - is-windows "^1.0.0" - -cross-spawn@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A== - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" + browserslist "^4.21.4" debug@2.6.8: version "2.6.8" @@ -930,63 +1173,39 @@ debug@2.6.8: dependencies: ms "2.0.0" -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== +debug@^4.1.0, debug@^4.1.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: - ms "2.0.0" + ms "2.1.2" decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - integrity sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A== - dependencies: - repeating "^2.0.0" - diff@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" integrity sha512-597ykPFhtJYaXqPq6fF7Vl1fXTKgPdLOntyxpmdzUOKiYGqK7zcnbplj5088+8qJnWdzXhyeau5iVr8HVo9dgg== +electron-to-chromium@^1.4.251: + version "1.4.284" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" + integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2: +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== @@ -996,100 +1215,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha512-hxx03P2dJxss6ceIeri9cmYOT4SRs3Zk3afZwWpOsRqLqprhTR8u++SlC+sFGsQr7WGFPdMF7Gjc1njDLDK6UA== - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha512-AFASGfIlnIbkKPQwX1yHaDjFvh/1gyKJODme52V6IORh69uEYgZp0o9C+qsIGNVEiuuhQU0CSSl++Rlegg1qvA== - dependencies: - fill-range "^2.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha512-1FOj1LOwn42TMrruOHGt18HemVnbwAmAak7krWk+wa93KXxGbK+2jpezm+ytJYDaBX0/SPLZFHKM7m+tKobWGg== - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha512-BTCqyBaWBTsauvnHiE8i562+EdJj+oUpkqWp2R1iCoR8f6oo8STRu3of7WJJ0TqWtxN50a5YFpzYK4Jj9esYfQ== - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1116,25 +1241,6 @@ flow-copy-source@^2.0.7: kefir "^3.7.3" yargs "^15.0.1" -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha512-SKmowqGTJoPzLO1T0BBJpkfp3EMacCMOuH40hOUbrbzElVktk4DioXVM99QkLCyKoiuOmyjgcWMpVz2xjE7LZw== - dependencies: - for-in "^1.0.1" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== - dependencies: - map-cache "^0.2.2" - fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -1144,7 +1250,7 @@ fs-extra@^8.1.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-readdir-recursive@^1.0.0: +fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== @@ -1154,44 +1260,26 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^1.0.0: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha512-ab1S1g1EbO7YzauaJLkgLp7DZVAqj9M/dvKlTt8DkXA2tiOIcSMrlVI2J1RZyB5iJVccEscjGn+kpOG9788MHA== - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha512-JDYOvfxio/t42HKdxkAYaCiBN7oYiuxykOxKxdaUW5Qn0zaYN3gRQWolrwdnf0shM9/EP0ebuuTmyoXNr1cC5w== - dependencies: - is-glob "^2.0.0" - glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -1211,7 +1299,7 @@ glob@7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.1.2: +glob@^7.0.0, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -1223,12 +1311,12 @@ glob@^7.0.0, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.18.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -graceful-fs@^4.1.11, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -1243,62 +1331,28 @@ growl@1.9.2: resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" integrity sha512-RTBwDHhNuOx4F0hqzItc/siXCasGfC4DeWcBamclWd+6jWtBaeB/SGbMkGf0eiQoW7ib8JpvOgnUsmgMHI3Mfw== -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== - dependencies: - ansi-regex "^2.0.0" - has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" integrity sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA== -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" + function-bind "^1.1.1" he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA== -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - integrity sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1307,39 +1361,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@~2.0.3: +inherits@2: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q== - dependencies: - binary-extensions "^1.0.0" - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -1347,94 +1373,23 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== +is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha512-9YclgOGtN/f8zx0Pr4FQYMdibBiTaH3sn52vjYip4ZSf6C4/6RfTEZ+MR4GvKhCxdPh21Bg42/WL55f6KSnKpg== - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha512-0EygVC5qPvIyb+gSz7zdD5/AAoS6Qrx1e//6N4yv4oNm30kqvdmG66oZFWVlQHUWe5OjP08FuTw2IdT0EOTcYA== - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww== + has "^1.0.3" is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg== - dependencies: - is-extglob "^1.0.0" - is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -1442,88 +1397,20 @@ is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg== - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha512-Yu68oeXJ7LeWNmZ3Zov/xg/oDBnBK2RNxwYY1ilNJX+tKKZqgPK+qOn/Gs9jEu66KDY9Netf5XLKNGzas/vPfQ== - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha512-N3w1tFaRfk3UrPfqeRyD+GYDASU3W5VinKhlORy8EWVf/sIdDL9GAcew85XmktCfH+ngG7SRXEVDoO18WMdB/Q== - -is-windows@^1.0.0, is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== - -"js-tokens@^3.0.0 || ^4.0.0": +js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - integrity sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA== +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== jsesc@~0.5.0: version "0.5.0" @@ -1535,10 +1422,10 @@ json3@3.3.2: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" integrity sha512-I5YLeauH3rIaE99EE++UeH2M2gSYo8/2TqDac7oZEH6D/DSQ4Woa628Qrfj1X9/OY5Mk5VvIDQaKCDchXaKrmA== -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw== +json5@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" + integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== jsonfile@^4.0.0: version "4.0.0" @@ -1552,30 +1439,6 @@ kefir@^3.7.3: resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.8.tgz#235932ddfbed422acebf5d7cba503035e9ea05c5" integrity sha512-xWga7QCZsR2Wjy2vNL3Kq/irT+IwxwItEWycRRlT5yhqHZK2fmEhziP+LzcJBWSTAMranGKtGTQ6lFpyJS3+jA== -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -1620,6 +1483,11 @@ lodash.create@3.1.1: lodash._basecreate "^3.0.0" lodash._isiterateecall "^3.0.0" +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" @@ -1639,82 +1507,22 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash@^4.17.4: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: - js-tokens "^3.0.0 || ^4.0.0" + yallist "^3.0.2" -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" + pify "^4.0.1" + semver "^5.6.0" -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== - dependencies: - object-visit "^1.0.0" - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha512-LnU2XFEk9xxSJ6rfgAry/ty5qwUTyHYOBU0g4R6tIw5ljwgGIBmiKhRWLw5NpMOnrgUNcDJ4WMp8rl3sYVHLNA== - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.2, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -1726,19 +1534,6 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q== -minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - mkdirp@0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -1746,13 +1541,6 @@ mkdirp@0.5.1: dependencies: minimist "0.0.8" -mkdirp@^0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - mocha@^3.2.0: version "3.5.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" @@ -1776,76 +1564,21 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== -nan@^2.12.1: - version "2.16.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" - integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" +node-releases@^2.0.6: + version "2.0.8" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" + integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== - dependencies: - isobject "^3.0.0" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha512-UiAM5mhmIuKLsOvrL+B0U2d1hXHF3bFYWIuH1LMpuV2EJEHG1Ntz06PgLEHjm6VFd87NpH8rastvPoyv6UW2fA== - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== - dependencies: - isobject "^3.0.1" - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1853,25 +1586,6 @@ once@^1.3.0: dependencies: wrappy "1" -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== - -os-tmpdir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - integrity sha512-uQLlclru4xpCi+tfs80l3QF24KL81X57ELNMy7W/dox+JTtxUf1bLyQ8968fFCmSqqbokjW0kn+WBIlO+rSkNg== - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" - p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -1891,91 +1605,35 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha512-FC5TeK0AwXzq3tUBFtH74naWkPQCEWs4K+xMxWZBlKDWu0bVHXGZa+KKqxKidd7xwhdZ19ZNuF2uO1M/r196HA== - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ== - -private@^0.1.6, private@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -readable-stream@^2.0.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== readdirp@~3.6.0: version "3.6.0" @@ -1984,88 +1642,54 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regenerate@^1.2.1: +regenerate-unicode-properties@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" + integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== + dependencies: + regenerate "^1.4.2" + +regenerate@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - integrity sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w== +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== +regenerator-transform@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" + integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" + "@babel/runtime" "^7.8.4" -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== +regexpu-core@^5.2.1: + version "5.2.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" + integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== dependencies: - is-equal-shallow "^0.1.3" + regenerate "^1.4.2" + regenerate-unicode-properties "^10.1.0" + regjsgen "^0.7.1" + regjsparser "^0.9.1" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" +regjsgen@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.7.1.tgz#ee5ef30e18d3f09b7c369b76e7c2373ed25546f6" + integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - integrity sha512-tJ9+S4oKjxY8IZ9jmjnp/mtytu1u3iyIQAfmI51IKWH6bFf7XR1ybtaO6j7INhZKXOTYADk7V5qxaqLkmNxiZQ== - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - integrity sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g== - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - integrity sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw== +regjsparser@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" + integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== dependencies: jsesc "~0.5.0" -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A== - dependencies: - is-finite "^1.0.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -2076,132 +1700,34 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== +resolve@^1.14.2: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: - ret "~0.1.10" + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +semver@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg== - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.4.15: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.6, source-map@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" @@ -2212,20 +1738,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== - dependencies: - ansi-regex "^2.0.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -2240,30 +1752,22 @@ supports-color@3.1.2: dependencies: has-flag "^1.0.0" -supports-color@^2.0.0: +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +to-fast-properties@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - integrity sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og== - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== to-regex-range@^5.0.1: version "5.0.1" @@ -2272,83 +1776,47 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" +unicode-canonical-property-names-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" + integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== +unicode-match-property-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" + unicode-canonical-property-names-ecmascript "^2.0.0" + unicode-property-aliases-ecmascript "^2.0.0" + +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== + +unicode-property-aliases-ecmascript@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== +update-browserslist-db@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - integrity sha512-aggiKfEEubv3UwRNqTzLInZpAOmKzwdHqEBmW/hBA/mt99eg+b4VrX6i+IRLxU8+WJYfa33rGwRseg4eElUgsQ== - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -v8flags@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - integrity sha512-SKfhk/LlaXzvtowJabLZwD4K6SGRYeoxA7KJeISlUMAB/NT4CBkZjMq3WceX2Ckm4llwqYVo8TICgsDYCBU2tA== - dependencies: - user-home "^1.1.1" + escalade "^3.1.1" + picocolors "^1.0.0" which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -2368,10 +1836,10 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A== +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yargs-parser@^18.1.2: version "18.1.3" -- 2.50.1.windows.1 From 2a9391ae8b4b762605e26dd01997cfd61154b84b Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 03:17:21 -0800 Subject: [PATCH 14/47] Fix run-bench --- javascript/tests/run-bench.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index 283aab3d..cc2946f9 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -21,12 +21,12 @@ let testFiles = process.argv.slice(2).map(file => { let testResults = new Map(); -for (let type of [`asm`]) { +for (let type of ['asm', 'wasm']) { for (let file of testFiles) { vm.runInNewContext( file, Object.assign(Object.create(global), { - Yoga: require('../dist'), + Yoga: require(type === 'asm' ? '../dist/index.asm' : '../dist/index.wasm'), YGBENCHMARK: function(name, fn) { let testEntry = testResults.get(name); -- 2.50.1.windows.1 From eeca7750a2273610e3d5818648254b5f99c87f62 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 03:34:57 -0800 Subject: [PATCH 15/47] Fix inconsistent whitespace --- javascript/Makefile | 94 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/javascript/Makefile b/javascript/Makefile index c0099ed7..3825a1f0 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -1,68 +1,68 @@ CXX=em++ SOURCES=\ - sources/yoga/*.cpp \ - sources/yoga/**/*.cpp \ - sources/*.cc + sources/yoga/*.cpp \ + sources/yoga/**/*.cpp \ + sources/*.cc CXXFLAGS=\ - -Isources \ - -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ - -std=c++11 \ - -g0 \ - -Os \ - -flto \ - -fno-exceptions \ - -fno-rtti \ + -Isources \ + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ + -std=c++11 \ + -g0 \ + -Os \ + -flto \ + -fno-exceptions \ + -fno-rtti \ EMCCFLAGS=\ - --closure 1 \ - --memory-init-file 0 \ - --no-entry + --closure 1 \ + --memory-init-file 0 \ + --no-entry EMCCOPTS=\ - -s ALLOW_MEMORY_GROWTH=1 \ - -s ASSERTIONS=0 \ - -s DEFAULT_TO_CXX=1 \ - -s DYNAMIC_EXECUTION=0 \ - -s ENVIRONMENT="web,node" \ - -s EXPORT_NAME="yoga" \ - -s FETCH_SUPPORT_INDEXEDDB=0 \ - -s FILESYSTEM=0 \ - -s MALLOC="emmalloc" \ - -s MODULARIZE=1 \ - -s STRICT=1 \ - -s TEXTDECODER=0 \ - -s USE_ES6_IMPORT_META=0 \ - -s WASM_ASYNC_COMPILATION=0 + -s ALLOW_MEMORY_GROWTH=1 \ + -s ASSERTIONS=0 \ + -s DEFAULT_TO_CXX=1 \ + -s DYNAMIC_EXECUTION=0 \ + -s ENVIRONMENT="web,node" \ + -s EXPORT_NAME="yoga" \ + -s FETCH_SUPPORT_INDEXEDDB=0 \ + -s FILESYSTEM=0 \ + -s MALLOC="emmalloc" \ + -s MODULARIZE=1 \ + -s STRICT=1 \ + -s TEXTDECODER=0 \ + -s USE_ES6_IMPORT_META=0 \ + -s WASM_ASYNC_COMPILATION=0 LDLIBS=\ - -lembind + -lembind all: clean dir asm wasm asm: - $(CXX) $(SOURCES) \ - $(INCLUDE) \ - $(CXXFLAGS) \ - $(EMCCFLAGS) \ - $(LDLIBS) \ - $(EMCCOPTS) \ - -s WASM=0 \ - -o dist/asm.js + $(CXX) $(SOURCES) \ + $(INCLUDE) \ + $(CXXFLAGS) \ + $(EMCCFLAGS) \ + $(LDLIBS) \ + $(EMCCOPTS) \ + -s WASM=0 \ + -o dist/asm.js wasm: - $(CXX) $(SOURCES) \ - $(INCLUDE) \ - $(CXXFLAGS) \ - $(EMCCFLAGS) \ - $(LDLIBS) \ - $(EMCCOPTS) \ - -s WASM=1 \ - -o dist/wasm.js + $(CXX) $(SOURCES) \ + $(INCLUDE) \ + $(CXXFLAGS) \ + $(EMCCFLAGS) \ + $(LDLIBS) \ + $(EMCCOPTS) \ + -s WASM=1 \ + -o dist/wasm.js clean: - rm -rf dist + rm -rf dist dir: - mkdir -p dist + mkdir -p dist -- 2.50.1.windows.1 From a948c485f83a2a002cfb55c15e7fb04b54c3c44a Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 03:52:23 -0800 Subject: [PATCH 16/47] Makefile expects tabs --- javascript/Makefile | 94 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/javascript/Makefile b/javascript/Makefile index 3825a1f0..3a2bb9c5 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -1,68 +1,68 @@ CXX=em++ SOURCES=\ - sources/yoga/*.cpp \ - sources/yoga/**/*.cpp \ - sources/*.cc + sources/yoga/*.cpp \ + sources/yoga/**/*.cpp \ + sources/*.cc CXXFLAGS=\ - -Isources \ - -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ - -std=c++11 \ - -g0 \ - -Os \ - -flto \ - -fno-exceptions \ - -fno-rtti \ + -Isources \ + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ + -std=c++11 \ + -g0 \ + -Os \ + -flto \ + -fno-exceptions \ + -fno-rtti \ EMCCFLAGS=\ - --closure 1 \ - --memory-init-file 0 \ - --no-entry + --closure 1 \ + --memory-init-file 0 \ + --no-entry EMCCOPTS=\ - -s ALLOW_MEMORY_GROWTH=1 \ - -s ASSERTIONS=0 \ - -s DEFAULT_TO_CXX=1 \ - -s DYNAMIC_EXECUTION=0 \ - -s ENVIRONMENT="web,node" \ - -s EXPORT_NAME="yoga" \ - -s FETCH_SUPPORT_INDEXEDDB=0 \ - -s FILESYSTEM=0 \ - -s MALLOC="emmalloc" \ - -s MODULARIZE=1 \ - -s STRICT=1 \ - -s TEXTDECODER=0 \ - -s USE_ES6_IMPORT_META=0 \ - -s WASM_ASYNC_COMPILATION=0 + -s ALLOW_MEMORY_GROWTH=1 \ + -s ASSERTIONS=0 \ + -s DEFAULT_TO_CXX=1 \ + -s DYNAMIC_EXECUTION=0 \ + -s ENVIRONMENT="web,node" \ + -s EXPORT_NAME="yoga" \ + -s FETCH_SUPPORT_INDEXEDDB=0 \ + -s FILESYSTEM=0 \ + -s MALLOC="emmalloc" \ + -s MODULARIZE=1 \ + -s STRICT=1 \ + -s TEXTDECODER=0 \ + -s USE_ES6_IMPORT_META=0 \ + -s WASM_ASYNC_COMPILATION=0 LDLIBS=\ - -lembind + -lembind all: clean dir asm wasm asm: - $(CXX) $(SOURCES) \ - $(INCLUDE) \ - $(CXXFLAGS) \ - $(EMCCFLAGS) \ - $(LDLIBS) \ - $(EMCCOPTS) \ - -s WASM=0 \ - -o dist/asm.js + $(CXX) $(SOURCES) \ + $(INCLUDE) \ + $(CXXFLAGS) \ + $(EMCCFLAGS) \ + $(LDLIBS) \ + $(EMCCOPTS) \ + -s WASM=0 \ + -o dist/asm.js wasm: - $(CXX) $(SOURCES) \ - $(INCLUDE) \ - $(CXXFLAGS) \ - $(EMCCFLAGS) \ - $(LDLIBS) \ - $(EMCCOPTS) \ - -s WASM=1 \ - -o dist/wasm.js + $(CXX) $(SOURCES) \ + $(INCLUDE) \ + $(CXXFLAGS) \ + $(EMCCFLAGS) \ + $(LDLIBS) \ + $(EMCCOPTS) \ + -s WASM=1 \ + -o dist/wasm.js clean: - rm -rf dist + rm -rf dist dir: - mkdir -p dist + mkdir -p dist -- 2.50.1.windows.1 From 09f0869262e50b90837688ef37ff84cc38b799be Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 03:59:36 -0800 Subject: [PATCH 17/47] clang-format the JS directory --- .github/actions/clang-format/action.yml | 2 +- .github/workflows/validate-cpp.yml | 5 + javascript/sources/Node.cc | 4 +- javascript/sources/Node.hh | 15 +- javascript/sources/Value.hh | 2 +- javascript/sources/embind.cc | 237 ++++++++++++------------ 6 files changed, 133 insertions(+), 132 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index a0d52af2..79508a14 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -21,4 +21,4 @@ runs: run: | shopt -s globstar shopt -s nullglob - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.cc **/*.h **/*.hh **/*.m **/*.mm diff --git a/.github/workflows/validate-cpp.yml b/.github/workflows/validate-cpp.yml index 3f4b4e7a..121bdb41 100644 --- a/.github/workflows/validate-cpp.yml +++ b/.github/workflows/validate-cpp.yml @@ -19,3 +19,8 @@ jobs: uses: ./.github/actions/clang-format with: directory: ./yoga + + - name: clang-format (JavaScript Bindings) + uses: ./.github/actions/clang-format + with: + directory: ./javascript diff --git a/javascript/sources/Node.cc b/javascript/sources/Node.cc index 7c71091a..daadf753 100644 --- a/javascript/sources/Node.cc +++ b/javascript/sources/Node.cc @@ -369,7 +369,7 @@ Node* Node::getChild(unsigned index) { return Node::fromYGNode(nodePtr); } -void Node::setMeasureFunc(MeasureCallback *measureFunc) { +void Node::setMeasureFunc(MeasureCallback* measureFunc) { m_measureFunc.reset(measureFunc); YGNodeSetMeasureFunc(m_node, &globalMeasureFunc); @@ -389,7 +389,7 @@ Size Node::callMeasureFunc( return m_measureFunc->measure(width, widthMode, height, heightMode); } -void Node::setDirtiedFunc(DirtiedCallback *dirtiedFunc) { +void Node::setDirtiedFunc(DirtiedCallback* dirtiedFunc) { m_dirtiedFunc.reset(dirtiedFunc); YGNodeSetDirtiedFunc(m_node, &globalDirtiedFunc); diff --git a/javascript/sources/Node.hh b/javascript/sources/Node.hh index 225b1727..d416f8e0 100644 --- a/javascript/sources/Node.hh +++ b/javascript/sources/Node.hh @@ -20,7 +20,8 @@ class MeasureCallback { public: virtual ~MeasureCallback() {} - virtual Size measure(float width, + virtual Size measure( + float width, int widthMode, float height, int heightMode) = 0; @@ -29,8 +30,7 @@ public: class MeasureCallbackWrapper : public emscripten::wrapper { public: EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper); - Size measure(float width, int widthMode, float height, int heightMode) - { + Size measure(float width, int widthMode, float height, int heightMode) { return call("measure", width, widthMode, height, heightMode); } }; @@ -44,10 +44,7 @@ public: class DirtiedCallbackWrapper : public emscripten::wrapper { public: EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper); - void dirtied() - { - return call("dirtied"); - } + void dirtied() { return call("dirtied"); } }; class Node { @@ -180,7 +177,7 @@ public: // Tree hierarchy inspectors Node* getChild(unsigned index); public: // Measure func mutators - void setMeasureFunc(MeasureCallback *measureFunc); + void setMeasureFunc(MeasureCallback* measureFunc); void unsetMeasureFunc(void); public: // Measure func inspectors @@ -191,7 +188,7 @@ public: // Measure func inspectors int heightMode) const; public: // Dirtied func mutators - void setDirtiedFunc(DirtiedCallback *dirtiedFunc); + void setDirtiedFunc(DirtiedCallback* dirtiedFunc); void unsetDirtiedFunc(void); public: // Dirtied func inspectors diff --git a/javascript/sources/Value.hh b/javascript/sources/Value.hh index 38267dea..2a37d0e9 100644 --- a/javascript/sources/Value.hh +++ b/javascript/sources/Value.hh @@ -19,5 +19,5 @@ struct Value { Value(void) : unit(YGUnitUndefined), value(0.0) {} - Value(int unit, double value) : unit(unit), value(value) {} + Value(int unit, double value) : unit(unit), value(value) {} }; diff --git a/javascript/sources/embind.cc b/javascript/sources/embind.cc index 32ee65ad..96d6b018 100644 --- a/javascript/sources/embind.cc +++ b/javascript/sources/embind.cc @@ -18,171 +18,170 @@ using namespace emscripten; EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) { class_("MeasureCallback") - .function("measure", &MeasureCallback::measure, pure_virtual()) - .allow_subclass("MeasureCallbackWrapper") - ; + .function("measure", &MeasureCallback::measure, pure_virtual()) + .allow_subclass("MeasureCallbackWrapper"); class_("DirtiedCallback") - .function("dirtied", &DirtiedCallback::dirtied, pure_virtual()) - .allow_subclass("DirtiedCallbackWrapper") - ; + .function("dirtied", &DirtiedCallback::dirtied, pure_virtual()) + .allow_subclass("DirtiedCallbackWrapper"); class_("Config") - .constructor<>(&Config::create, allow_raw_pointers()) - .class_function<>("create", &Config::create, allow_raw_pointers()) - .class_function<>("destroy", &Config::destroy, allow_raw_pointers()) - .function("setExperimentalFeatureEnabled", &Config::setExperimentalFeatureEnabled) - .function("setPointScaleFactor", &Config::setPointScaleFactor) - .function("isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled) - ; + .constructor<>(&Config::create, allow_raw_pointers()) + .class_function<>("create", &Config::create, allow_raw_pointers()) + .class_function<>("destroy", &Config::destroy, allow_raw_pointers()) + .function( + "setExperimentalFeatureEnabled", + &Config::setExperimentalFeatureEnabled) + .function("setPointScaleFactor", &Config::setPointScaleFactor) + .function( + "isExperimentalFeatureEnabled", + &Config::isExperimentalFeatureEnabled); value_object("Layout") - .field("left", &Layout::left) - .field("right", &Layout::right) - .field("top", &Layout::top) - .field("bottom", &Layout::bottom) - .field("width", &Layout::width) - .field("height", &Layout::height) - ; + .field("left", &Layout::left) + .field("right", &Layout::right) + .field("top", &Layout::top) + .field("bottom", &Layout::bottom) + .field("width", &Layout::width) + .field("height", &Layout::height); value_object("Size") - .field("width", &Size::width) - .field("height", &Size::height) - ; + .field("width", &Size::width) + .field("height", &Size::height); value_object("Value") - .field("value", &Value::value) - .field("unit", &Value::unit) - ; + .field("value", &Value::value) + .field("unit", &Value::unit); class_("Node") - .constructor<>(&Node::createDefault, allow_raw_pointers()) + .constructor<>(&Node::createDefault, allow_raw_pointers()) - .class_function<>("createDefault", &Node::createDefault, allow_raw_pointers()) - .class_function<>("createWithConfig", &Node::createWithConfig, allow_raw_pointers()) - .class_function<>("destroy", &Node::destroy, allow_raw_pointers()) - .function("reset", &Node::reset) + .class_function<>( + "createDefault", &Node::createDefault, allow_raw_pointers()) + .class_function<>( + "createWithConfig", &Node::createWithConfig, allow_raw_pointers()) + .class_function<>("destroy", &Node::destroy, allow_raw_pointers()) + .function("reset", &Node::reset) - .function("copyStyle", &Node::copyStyle) + .function("copyStyle", &Node::copyStyle) - .function("setPositionType", &Node::setPositionType) - .function("setPosition", &Node::setPosition) - .function("setPositionPercent", &Node::setPositionPercent) + .function("setPositionType", &Node::setPositionType) + .function("setPosition", &Node::setPosition) + .function("setPositionPercent", &Node::setPositionPercent) - .function("setAlignContent", &Node::setAlignContent) - .function("setAlignItems", &Node::setAlignItems) - .function("setAlignSelf", &Node::setAlignSelf) - .function("setFlexDirection", &Node::setFlexDirection) - .function("setFlexWrap", &Node::setFlexWrap) - .function("setJustifyContent", &Node::setJustifyContent) + .function("setAlignContent", &Node::setAlignContent) + .function("setAlignItems", &Node::setAlignItems) + .function("setAlignSelf", &Node::setAlignSelf) + .function("setFlexDirection", &Node::setFlexDirection) + .function("setFlexWrap", &Node::setFlexWrap) + .function("setJustifyContent", &Node::setJustifyContent) - .function("setMargin", &Node::setMargin) - .function("setMarginPercent", &Node::setMarginPercent) - .function("setMarginAuto", &Node::setMarginAuto) + .function("setMargin", &Node::setMargin) + .function("setMarginPercent", &Node::setMarginPercent) + .function("setMarginAuto", &Node::setMarginAuto) - .function("setOverflow", &Node::setOverflow) - .function("setDisplay", &Node::setDisplay) + .function("setOverflow", &Node::setOverflow) + .function("setDisplay", &Node::setDisplay) - .function("setFlex", &Node::setFlex) - .function("setFlexBasis", &Node::setFlexBasis) - .function("setFlexBasisPercent", &Node::setFlexBasisPercent) - .function("setFlexGrow", &Node::setFlexGrow) - .function("setFlexShrink", &Node::setFlexShrink) + .function("setFlex", &Node::setFlex) + .function("setFlexBasis", &Node::setFlexBasis) + .function("setFlexBasisPercent", &Node::setFlexBasisPercent) + .function("setFlexGrow", &Node::setFlexGrow) + .function("setFlexShrink", &Node::setFlexShrink) - .function("setWidth", &Node::setWidth) - .function("setWidthPercent", &Node::setWidthPercent) - .function("setWidthAuto", &Node::setWidthAuto) - .function("setHeight", &Node::setHeight) - .function("setHeightPercent", &Node::setHeightPercent) - .function("setHeightAuto", &Node::setHeightAuto) + .function("setWidth", &Node::setWidth) + .function("setWidthPercent", &Node::setWidthPercent) + .function("setWidthAuto", &Node::setWidthAuto) + .function("setHeight", &Node::setHeight) + .function("setHeightPercent", &Node::setHeightPercent) + .function("setHeightAuto", &Node::setHeightAuto) - .function("setMinWidth", &Node::setMinWidth) - .function("setMinWidthPercent", &Node::setMinWidthPercent) - .function("setMinHeight", &Node::setMinHeight) - .function("setMinHeightPercent", &Node::setMinHeightPercent) + .function("setMinWidth", &Node::setMinWidth) + .function("setMinWidthPercent", &Node::setMinWidthPercent) + .function("setMinHeight", &Node::setMinHeight) + .function("setMinHeightPercent", &Node::setMinHeightPercent) - .function("setMaxWidth", &Node::setMaxWidth) - .function("setMaxWidthPercent", &Node::setMaxWidthPercent) - .function("setMaxHeight", &Node::setMaxHeight) - .function("setMaxHeightPercent", &Node::setMaxHeightPercent) + .function("setMaxWidth", &Node::setMaxWidth) + .function("setMaxWidthPercent", &Node::setMaxWidthPercent) + .function("setMaxHeight", &Node::setMaxHeight) + .function("setMaxHeightPercent", &Node::setMaxHeightPercent) - .function("setAspectRatio", &Node::setAspectRatio) + .function("setAspectRatio", &Node::setAspectRatio) - .function("setBorder", &Node::setBorder) + .function("setBorder", &Node::setBorder) - .function("setPadding", &Node::setPadding) - .function("setPaddingPercent", &Node::setPaddingPercent) - .function("setGap", &Node::setGap) + .function("setPadding", &Node::setPadding) + .function("setPaddingPercent", &Node::setPaddingPercent) + .function("setGap", &Node::setGap) - .function("getPositionType", &Node::getPositionType) - .function("getPosition", &Node::getPosition) + .function("getPositionType", &Node::getPositionType) + .function("getPosition", &Node::getPosition) - .function("getAlignContent", &Node::getAlignContent) - .function("getAlignItems", &Node::getAlignItems) - .function("getAlignSelf", &Node::getAlignSelf) - .function("getFlexDirection", &Node::getFlexDirection) - .function("getFlexWrap", &Node::getFlexWrap) - .function("getJustifyContent", &Node::getJustifyContent) + .function("getAlignContent", &Node::getAlignContent) + .function("getAlignItems", &Node::getAlignItems) + .function("getAlignSelf", &Node::getAlignSelf) + .function("getFlexDirection", &Node::getFlexDirection) + .function("getFlexWrap", &Node::getFlexWrap) + .function("getJustifyContent", &Node::getJustifyContent) - .function("getMargin", &Node::getMargin) + .function("getMargin", &Node::getMargin) - .function("getFlexBasis", &Node::getFlexBasis) - .function("getFlexGrow", &Node::getFlexGrow) - .function("getFlexShrink", &Node::getFlexShrink) + .function("getFlexBasis", &Node::getFlexBasis) + .function("getFlexGrow", &Node::getFlexGrow) + .function("getFlexShrink", &Node::getFlexShrink) - .function("getWidth", &Node::getWidth) - .function("getHeight", &Node::getHeight) + .function("getWidth", &Node::getWidth) + .function("getHeight", &Node::getHeight) - .function("getMinWidth", &Node::getMinWidth) - .function("getMinHeight", &Node::getMinHeight) + .function("getMinWidth", &Node::getMinWidth) + .function("getMinHeight", &Node::getMinHeight) - .function("getMaxWidth", &Node::getMaxWidth) - .function("getMaxHeight", &Node::getMaxHeight) + .function("getMaxWidth", &Node::getMaxWidth) + .function("getMaxHeight", &Node::getMaxHeight) - .function("getAspectRatio", &Node::getAspectRatio) + .function("getAspectRatio", &Node::getAspectRatio) - .function("getBorder", &Node::getBorder) + .function("getBorder", &Node::getBorder) - .function("getOverflow", &Node::getOverflow) - .function("getDisplay", &Node::getDisplay) + .function("getOverflow", &Node::getOverflow) + .function("getDisplay", &Node::getDisplay) - .function("getPadding", &Node::getPadding) - .function("getGap", &Node::getGap) + .function("getPadding", &Node::getPadding) + .function("getGap", &Node::getGap) - .function("insertChild", &Node::insertChild, allow_raw_pointers()) - .function("removeChild", &Node::removeChild, allow_raw_pointers()) + .function("insertChild", &Node::insertChild, allow_raw_pointers()) + .function("removeChild", &Node::removeChild, allow_raw_pointers()) - .function("getChildCount", &Node::getChildCount) + .function("getChildCount", &Node::getChildCount) - .function("getParent", &Node::getParent, allow_raw_pointers()) - .function("getChild", &Node::getChild, allow_raw_pointers()) + .function("getParent", &Node::getParent, allow_raw_pointers()) + .function("getChild", &Node::getChild, allow_raw_pointers()) - .function("isReferenceBaseline", &Node::isReferenceBaseline) - .function("setIsReferenceBaseline", &Node::setIsReferenceBaseline) + .function("isReferenceBaseline", &Node::isReferenceBaseline) + .function("setIsReferenceBaseline", &Node::setIsReferenceBaseline) - .function("setMeasureFunc", &Node::setMeasureFunc, allow_raw_pointers()) - .function("unsetMeasureFunc", &Node::unsetMeasureFunc) + .function("setMeasureFunc", &Node::setMeasureFunc, allow_raw_pointers()) + .function("unsetMeasureFunc", &Node::unsetMeasureFunc) - .function("setDirtiedFunc", &Node::setDirtiedFunc, allow_raw_pointers()) - .function("unsetDirtiedFunc", &Node::unsetDirtiedFunc) + .function("setDirtiedFunc", &Node::setDirtiedFunc, allow_raw_pointers()) + .function("unsetDirtiedFunc", &Node::unsetDirtiedFunc) - .function("markDirty", &Node::markDirty) - .function("isDirty", &Node::isDirty) + .function("markDirty", &Node::markDirty) + .function("isDirty", &Node::isDirty) - .function("calculateLayout", &Node::calculateLayout) + .function("calculateLayout", &Node::calculateLayout) - .function("getComputedLeft", &Node::getComputedLeft) - .function("getComputedRight", &Node::getComputedRight) + .function("getComputedLeft", &Node::getComputedLeft) + .function("getComputedRight", &Node::getComputedRight) - .function("getComputedTop", &Node::getComputedTop) - .function("getComputedBottom", &Node::getComputedBottom) + .function("getComputedTop", &Node::getComputedTop) + .function("getComputedBottom", &Node::getComputedBottom) - .function("getComputedWidth", &Node::getComputedWidth) - .function("getComputedHeight", &Node::getComputedHeight) + .function("getComputedWidth", &Node::getComputedWidth) + .function("getComputedHeight", &Node::getComputedHeight) - .function("getComputedLayout", &Node::getComputedLayout) + .function("getComputedLayout", &Node::getComputedLayout) - .function("getComputedMargin", &Node::getComputedMargin) - .function("getComputedBorder", &Node::getComputedBorder) - .function("getComputedPadding", &Node::getComputedPadding) - ; + .function("getComputedMargin", &Node::getComputedMargin) + .function("getComputedBorder", &Node::getComputedBorder) + .function("getComputedPadding", &Node::getComputedPadding); } -- 2.50.1.windows.1 From 5561d9e651c72a2c45052cca6678a758a4202803 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Dec 2022 05:49:05 -0800 Subject: [PATCH 18/47] Make async, and test both wasm and asm using jest --- gentest/gentest-javascript.js | 7 +- javascript/Makefile | 3 +- javascript/jest.config.js | 14 + javascript/jest.setup.js | 69 + javascript/package.json | 13 +- javascript/sources/entry.js | 12 +- .../Facebook.Yoga/YGAbsolutePositionTest.js | 2 - .../Facebook.Yoga/YGAlignBaselineTest.js | 2 - .../tests/Facebook.Yoga/YGAlignContentTest.js | 2 - .../tests/Facebook.Yoga/YGAlignItemsTest.js | 2 - .../tests/Facebook.Yoga/YGAlignSelfTest.js | 2 - .../tests/Facebook.Yoga/YGAndroidNewsFeed.js | 2 - .../tests/Facebook.Yoga/YGBorderTest.js | 2 - .../Facebook.Yoga/YGComputedBorderTest.js | 2 - .../Facebook.Yoga/YGComputedMarginTest.js | 2 - .../Facebook.Yoga/YGComputedPaddingTest.js | 2 - .../tests/Facebook.Yoga/YGDimensionTest.js | 2 - .../tests/Facebook.Yoga/YGDirtiedTest.js | 2 - .../tests/Facebook.Yoga/YGDisplayTest.js | 2 - .../Facebook.Yoga/YGFlexDirectionTest.js | 2 - javascript/tests/Facebook.Yoga/YGFlexTest.js | 2 - .../tests/Facebook.Yoga/YGFlexWrapTest.js | 2 - javascript/tests/Facebook.Yoga/YGGapTest.js | 2 - .../Facebook.Yoga/YGJustifyContentTest.js | 2 - .../tests/Facebook.Yoga/YGMarginTest.js | 2 - .../tests/Facebook.Yoga/YGMeasureCacheTest.js | 2 - .../tests/Facebook.Yoga/YGMeasureTest.js | 2 - .../Facebook.Yoga/YGMinMaxDimensionTest.js | 2 - .../tests/Facebook.Yoga/YGPaddingTest.js | 2 - .../tests/Facebook.Yoga/YGPercentageTest.js | 2 - .../tests/Facebook.Yoga/YGRoundingTest.js | 2 - .../tests/Facebook.Yoga/YGSizeOverflowTest.js | 2 - javascript/yarn.lock | 1615 +++++++++++++++-- 33 files changed, 1537 insertions(+), 248 deletions(-) create mode 100644 javascript/jest.config.js create mode 100644 javascript/jest.setup.js diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index b84c60af..051049ab 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -31,12 +31,7 @@ function toJavascriptUpper(symbol) { JavascriptEmitter.prototype = Object.create(Emitter.prototype, { constructor:{value:JavascriptEmitter}, - emitPrologue:{value:function() { - this.push([ - 'var Yoga = Yoga || require("../..");', - '' - ]); - }}, + emitPrologue:{value:function() {}}, emitTestPrologue:{value:function(name, experiments) { this.push('it(' + JSON.stringify(name) + ', function () {'); diff --git a/javascript/Makefile b/javascript/Makefile index 3a2bb9c5..c74291fa 100644 --- a/javascript/Makefile +++ b/javascript/Makefile @@ -33,8 +33,7 @@ EMCCOPTS=\ -s MODULARIZE=1 \ -s STRICT=1 \ -s TEXTDECODER=0 \ - -s USE_ES6_IMPORT_META=0 \ - -s WASM_ASYNC_COMPILATION=0 + -s USE_ES6_IMPORT_META=0 LDLIBS=\ -lembind diff --git a/javascript/jest.config.js b/javascript/jest.config.js new file mode 100644 index 00000000..8129bc93 --- /dev/null +++ b/javascript/jest.config.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +module.exports = { + setupFiles: ["./jest.setup.js"], + testRegex: '/tests/Facebook.Yoga/.*\\.js$', + watchman: false, +} diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js new file mode 100644 index 00000000..5ee9275e --- /dev/null +++ b/javascript/jest.setup.js @@ -0,0 +1,69 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +module.exports = async () => { + global.Yoga = process.env['WASM'] + ? await require("./dist/index.wasm").initialize() + : await require("./dist/index.asm").initialize(); + + global.getMeasureCounter = function(Yoga, cb, staticWidth, staticHeight) { + var counter = 0; + + return { + inc: function(width, widthMode, height, heightMode) { + counter += 1; + + return cb + ? cb(width, widthMode, height, heightMode) + : {width: staticWidth, height: staticHeight}; + }, + + get: function() { + return counter; + }, + }; + }; + + global.getMeasureCounterMax = function(Yoga) { + return getMeasureCounter(Yoga, function( + width, + widthMode, + height, + heightMode, + ) { + var measuredWidth = widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; + var measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; + + return {width: measuredWidth, height: measuredHeight}; + }); + }; + + global.getMeasureCounterMin = function(Yoga) { + return getMeasureCounter(Yoga, function( + width, + widthMode, + height, + heightMode, + ) { + var measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED || + (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) + ? 10 + : width; + var measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED || + (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) + ? 10 + : height; + + return {width: measuredWidth, height: measuredHeight}; + }); + }; +} diff --git a/javascript/package.json b/javascript/package.json index 89813214..539534b7 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -7,29 +7,30 @@ "type": "git", "url": "git@github.com:facebook/yoga.git" }, - "main": "./dist/index.asm.js", "exports": { ".": { - "default": "./dist/index.asm.js", "browser": "./dist/index.wasm.js", "node": "./dist/index.wasm.js", - "react-native": "./dist/index.asm.js" + "react-native": "./dist/index.asm.js", + "default": "./dist/index.asm.js" } }, "scripts": { "is-monolithic": "test \"$(basename \"$(pwd)\")\" = javascript", "copy-sources": "! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)", "build": "npm run copy-sources && make && npm run build:js", - "test": "time mocha --expose-gc -r tests/tools.js tests/Facebook.Yoga/**/*.js", + "test": "yarn test:asm && yarn test:wasm", + "test:asm": "jest", + "test:wasm": "WASM=1 jest", "benchmark": "npm run build && node tests/run-bench $(find tests/Benchmarks -name '*.js')", "build:js": "babel sources --source-maps --out-dir dist && flow-copy-source sources dist" }, "devDependencies": { "@babel/cli": "^7.20.7", - "@babel/core":"^7.20.7", + "@babel/core": "^7.20.7", "@babel/plugin-transform-flow-strip-types": "^7.19.0", "@babel/preset-env": "^7.20.2", "flow-copy-source": "^2.0.7", - "mocha": "^3.2.0" + "jest": "^29.3.1" } } diff --git a/javascript/sources/entry.js b/javascript/sources/entry.js index cbc61c69..a30485d3 100644 --- a/javascript/sources/entry.js +++ b/javascript/sources/entry.js @@ -76,7 +76,7 @@ class Size { expose(this.width, this.height); } - toString() { + toString() {s return ``; } } @@ -216,6 +216,10 @@ export type Yoga$Node = { unsetMeasureFun(): void, }; +type YogaConstructor = { + initialize: () => Promise; +} + type Yoga = { Config: { create(): Yoga$Config, @@ -234,7 +238,7 @@ type Yoga = { ...typeof CONSTANTS, }; -module.exports = (lib: any): Yoga => { +function wrapLib(lib: any): Yoga { function patch(prototype, name, fn) { let original = prototype[name]; @@ -374,3 +378,7 @@ module.exports = (lib: any): Yoga => { ...CONSTANTS, }; }; + +module.exports = (libPromise: any) => ({ + initialize: () => libPromise.then(wrapLib) +}: YogaConstructor); diff --git a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js index 3c671c83..ce400d29 100644 --- a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js +++ b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -var Yoga = Yoga || require("../.."); - it("absolute_layout_width_height_start_top", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js index 84a8df09..64d346b0 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("align_baseline_parent_using_child_in_column_as_reference", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js index 8e132fb9..74afca92 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -var Yoga = Yoga || require("../.."); - it("align_content_flex_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js index b8867511..be25bd46 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -var Yoga = Yoga || require("../.."); - it("align_items_stretch", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js index ca44dbe2..554c2e1d 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js +++ b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -var Yoga = Yoga || require("../.."); - it("align_self_center", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js index 02f1410c..c18a3b8e 100644 --- a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js +++ b/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -var Yoga = Yoga || require("../.."); - it("android_news_feed", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGBorderTest.js b/javascript/tests/Facebook.Yoga/YGBorderTest.js index fa9a4359..9f2e2034 100644 --- a/javascript/tests/Facebook.Yoga/YGBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGBorderTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -var Yoga = Yoga || require("../.."); - it("border_no_size", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js index 8d080f8c..dc491aad 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("border_start", function () { var root = Yoga.Node.create(); root.setWidth(100); diff --git a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js index d31b36a9..9b89e9d7 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("margin_start", function () { var root = Yoga.Node.create(); root.setWidth(100); diff --git a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js index f083be5f..d9576450 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("padding_start", function () { var root = Yoga.Node.create(); root.setWidth(100); diff --git a/javascript/tests/Facebook.Yoga/YGDimensionTest.js b/javascript/tests/Facebook.Yoga/YGDimensionTest.js index aee5b110..580e6f46 100644 --- a/javascript/tests/Facebook.Yoga/YGDimensionTest.js +++ b/javascript/tests/Facebook.Yoga/YGDimensionTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -var Yoga = Yoga || require("../.."); - it("wrap_child", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js index 9c443535..d6e201cf 100644 --- a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js +++ b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("dirtied", function() { var root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); diff --git a/javascript/tests/Facebook.Yoga/YGDisplayTest.js b/javascript/tests/Facebook.Yoga/YGDisplayTest.js index eab71283..62bc100a 100644 --- a/javascript/tests/Facebook.Yoga/YGDisplayTest.js +++ b/javascript/tests/Facebook.Yoga/YGDisplayTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -var Yoga = Yoga || require("../.."); - it("display_none", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js index c6fa02b8..f45f3ebf 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -var Yoga = Yoga || require("../.."); - it("flex_direction_column_no_height", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexTest.js b/javascript/tests/Facebook.Yoga/YGFlexTest.js index d34f7914..8898db29 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -var Yoga = Yoga || require("../.."); - it("flex_basis_flex_grow_column", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js index d1760de9..bfa3f938 100644 --- a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js +++ b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -var Yoga = Yoga || require("../.."); - it("wrap_column", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGGapTest.js b/javascript/tests/Facebook.Yoga/YGGapTest.js index 4fa6f019..c178f66a 100644 --- a/javascript/tests/Facebook.Yoga/YGGapTest.js +++ b/javascript/tests/Facebook.Yoga/YGGapTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -var Yoga = Yoga || require("../.."); - it("column_gap_flexible", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js index 276d05c3..89cc28a2 100644 --- a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js +++ b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -var Yoga = Yoga || require("../.."); - it("justify_content_row_flex_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/Facebook.Yoga/YGMarginTest.js index 6dab9ef3..46a8a25c 100644 --- a/javascript/tests/Facebook.Yoga/YGMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGMarginTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -var Yoga = Yoga || require("../.."); - it("margin_start", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js index d1703792..8b717f58 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("measure_once_single_flexible_child", function () { var root = Yoga.Node.create(); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/Facebook.Yoga/YGMeasureTest.js index c72aa46a..69b02134 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureTest.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../.."); - it("dont_measure_single_grow_shrink_child", function () { var root = Yoga.Node.create(); root.setWidth(100); diff --git a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js index 75e256de..5dc664f7 100644 --- a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js +++ b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -var Yoga = Yoga || require("../.."); - it("max_width", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGPaddingTest.js b/javascript/tests/Facebook.Yoga/YGPaddingTest.js index f08ea7aa..7c66af06 100644 --- a/javascript/tests/Facebook.Yoga/YGPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGPaddingTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -var Yoga = Yoga || require("../.."); - it("padding_no_size", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGPercentageTest.js b/javascript/tests/Facebook.Yoga/YGPercentageTest.js index 1d8745a5..d9193507 100644 --- a/javascript/tests/Facebook.Yoga/YGPercentageTest.js +++ b/javascript/tests/Facebook.Yoga/YGPercentageTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -var Yoga = Yoga || require("../.."); - it("percentage_width_height", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/Facebook.Yoga/YGRoundingTest.js index 222d6b39..d599175f 100644 --- a/javascript/tests/Facebook.Yoga/YGRoundingTest.js +++ b/javascript/tests/Facebook.Yoga/YGRoundingTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -var Yoga = Yoga || require("../.."); - it("rounding_flex_basis_flex_grow_row_width_of_100", function () { var config = Yoga.Config.create(); diff --git a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js index 2f0d8ef9..99b676a4 100644 --- a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js +++ b/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js @@ -7,8 +7,6 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -var Yoga = Yoga || require("../.."); - it("nested_overflowing_child", function () { var config = Yoga.Config.create(); diff --git a/javascript/yarn.lock b/javascript/yarn.lock index 9f8e6ad3..e994255b 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -26,7 +26,7 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.18.6": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== @@ -38,7 +38,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733" integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g== -"@babel/core@^7.20.7": +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.7.tgz#37072f951bd4d28315445f66e0ec9f6ae0c8c35f" integrity sha512-t1ZjCluspe5DW24bn2Rr1CDb2v9rn/hROtg9a2tmd0+QYf4bsloYfLQzjG4qHPNMhWtKdGC33R5AxGR2Af2cBw== @@ -59,7 +59,7 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.20.7": +"@babel/generator@^7.20.7", "@babel/generator@^7.7.2": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== @@ -280,7 +280,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.20.7": +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== @@ -437,7 +437,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.12.13": +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== @@ -479,6 +486,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.19.0" +"@babel/plugin-syntax-import-meta@^7.8.3": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" @@ -486,7 +500,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" + integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== @@ -500,7 +521,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.10.4": +"@babel/plugin-syntax-numeric-separator@^7.10.4", "@babel/plugin-syntax-numeric-separator@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== @@ -535,13 +556,20 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-top-level-await@^7.14.5": +"@babel/plugin-syntax-top-level-await@^7.14.5", "@babel/plugin-syntax-top-level-await@^7.8.3": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" +"@babel/plugin-syntax-typescript@^7.7.2": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7" + integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/plugin-transform-arrow-functions@^7.18.6": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" @@ -900,7 +928,7 @@ dependencies: regenerator-runtime "^0.13.11" -"@babel/template@^7.18.10", "@babel/template@^7.20.7": +"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== @@ -909,7 +937,7 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7": +"@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.7.tgz#114f992fa989a390896ea72db5220780edab509c" integrity sha512-xueOL5+ZKX2dJbg8z8o4f4uTRTqGDRjilva9D1hiRlayJbTY8jBRL+Ph67IeRTIE439/VifHk+Z4g0SwRtQE0A== @@ -925,7 +953,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== @@ -934,6 +962,219 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.3.1.tgz#3e3f876e4e47616ea3b1464b9fbda981872e9583" + integrity sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg== + dependencies: + "@jest/types" "^29.3.1" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + slash "^3.0.0" + +"@jest/core@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.3.1.tgz#bff00f413ff0128f4debec1099ba7dcd649774a1" + integrity sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw== + dependencies: + "@jest/console" "^29.3.1" + "@jest/reporters" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.2.0" + jest-config "^29.3.1" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" + jest-regex-util "^29.2.0" + jest-resolve "^29.3.1" + jest-resolve-dependencies "^29.3.1" + jest-runner "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" + jest-watcher "^29.3.1" + micromatch "^4.0.4" + pretty-format "^29.3.1" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.3.1.tgz#eb039f726d5fcd14698acd072ac6576d41cfcaa6" + integrity sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag== + dependencies: + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + jest-mock "^29.3.1" + +"@jest/expect-utils@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" + integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== + dependencies: + jest-get-type "^29.2.0" + +"@jest/expect@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.3.1.tgz#456385b62894349c1d196f2d183e3716d4c6a6cd" + integrity sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg== + dependencies: + expect "^29.3.1" + jest-snapshot "^29.3.1" + +"@jest/fake-timers@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.3.1.tgz#b140625095b60a44de820876d4c14da1aa963f67" + integrity sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A== + dependencies: + "@jest/types" "^29.3.1" + "@sinonjs/fake-timers" "^9.1.2" + "@types/node" "*" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" + jest-util "^29.3.1" + +"@jest/globals@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.3.1.tgz#92be078228e82d629df40c3656d45328f134a0c6" + integrity sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/types" "^29.3.1" + jest-mock "^29.3.1" + +"@jest/reporters@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.3.1.tgz#9a6d78c109608e677c25ddb34f907b90e07b4310" + integrity sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@jridgewell/trace-mapping" "^0.3.15" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^5.1.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + jest-worker "^29.3.1" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + +"@jest/schemas@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" + integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== + dependencies: + "@sinclair/typebox" "^0.24.1" + +"@jest/source-map@^29.2.0": + version "29.2.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744" + integrity sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ== + dependencies: + "@jridgewell/trace-mapping" "^0.3.15" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.3.1.tgz#92cd5099aa94be947560a24610aa76606de78f50" + integrity sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw== + dependencies: + "@jest/console" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.3.1.tgz#fa24b3b050f7a59d48f7ef9e0b782ab65123090d" + integrity sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA== + dependencies: + "@jest/test-result" "^29.3.1" + graceful-fs "^4.2.9" + jest-haste-map "^29.3.1" + slash "^3.0.0" + +"@jest/transform@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.3.1.tgz#1e6bd3da4af50b5c82a539b7b1f3770568d6e36d" + integrity sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.3.1" + "@jridgewell/trace-mapping" "^0.3.15" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.3.1" + jest-regex-util "^29.2.0" + jest-util "^29.3.1" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.1" + +"@jest/types@^29.3.1": + version "29.3.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" + integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== + dependencies: + "@jest/schemas" "^29.0.0" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -966,7 +1207,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.8", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -979,6 +1220,118 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== +"@sinclair/typebox@^0.24.1": + version "0.24.51" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" + integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== + +"@sinonjs/commons@^1.7.0": + version "1.8.6" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" + integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^9.1.2": + version "9.1.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" + integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== + dependencies: + "@sinonjs/commons" "^1.7.0" + +"@types/babel__core@^7.1.14": + version "7.1.20" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359" + integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.4" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" + integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.1" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" + integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.18.3" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d" + integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w== + dependencies: + "@babel/types" "^7.3.0" + +"@types/graceful-fs@^4.1.3": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" + integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + +"@types/istanbul-lib-report@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/node@*": + version "18.11.17" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.17.tgz#5c009e1d9c38f4a2a9d45c0b0c493fe6cdb4bcb5" + integrity sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng== + +"@types/prettier@^2.1.5": + version "2.7.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" + integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + +"@types/stack-utils@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + +"@types/yargs-parser@*": + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + +"@types/yargs@^17.0.8": + version "17.0.17" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.17.tgz#5672e5621f8e0fca13f433a8017aae4b7a2a03e7" + integrity sha512-72bWxFKTK6uwWJAVT+3rF6Jo6RTojiJ27FQo8Rf60AL+VZbzoVPnMFhKsUnbjR8A3BTCYQ7Mv3hnl8T0A+CX9g== + dependencies: + "@types/yargs-parser" "*" + +ansi-escapes@^4.2.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -991,13 +1344,26 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.0.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +anymatch@^3.0.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -1006,6 +1372,47 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +babel-jest@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" + integrity sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA== + dependencies: + "@jest/transform" "^29.3.1" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.2.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.2.0.tgz#23ee99c37390a98cfddf3ef4a78674180d823094" + integrity sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + babel-plugin-polyfill-corejs2@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" @@ -1030,6 +1437,32 @@ babel-plugin-polyfill-regenerator@^0.4.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.3.3" +babel-preset-current-node-syntax@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" + integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.8.3" + "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.8.3" + +babel-preset-jest@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.2.0.tgz#3048bea3a1af222e3505e4a767a974c95a7620dc" + integrity sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA== + dependencies: + babel-plugin-jest-hoist "^29.2.0" + babel-preset-current-node-syntax "^1.0.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -1048,18 +1481,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@~3.0.2: +braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - integrity sha512-7Rfk377tpSM9TWBEeHs0FlDZGoAIei2V/4MdZJoFMBFAK6BqLpxAIUepGRHGdPFgGsLb02PXovC4qddyHvQqTg== - browserslist@^4.21.3, browserslist@^4.21.4: version "4.21.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" @@ -1070,11 +1498,33 @@ browserslist@^4.21.3, browserslist@^4.21.4: node-releases "^2.0.6" update-browserslist-db "^1.0.9" -camelcase@^5.0.0: +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + caniuse-lite@^1.0.30001400: version "1.0.30001441" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" @@ -1089,6 +1539,19 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + chokidar@^3.0.0, chokidar@^3.4.0: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -1104,6 +1567,16 @@ chokidar@^3.0.0, chokidar@^3.4.0: optionalDependencies: fsevents "~2.3.2" +ci-info@^3.2.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef" + integrity sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog== + +cjs-module-lexer@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" + integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== + cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -1113,6 +1586,25 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" + integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -1137,13 +1629,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -commander@2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - integrity sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A== - dependencies: - graceful-readlink ">= 1.0.0" - commander@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" @@ -1154,11 +1639,16 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -convert-source-map@^1.1.0, convert-source-map@^1.7.0: +convert-source-map@^1.1.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + core-js-compat@^3.25.1: version "3.26.1" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.1.tgz#0e710b09ebf689d719545ac36e49041850f943df" @@ -1166,12 +1656,14 @@ core-js-compat@^3.25.1: dependencies: browserslist "^4.21.4" -debug@2.6.8: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - integrity sha512-E22fsyWPt/lr4/UgQLt/pXqerGMDsanhbnmqIS3VAXuDi1v3IpiwXe2oncEIondHSBuPDWRoK/pMjlvi8FuOXQ== +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: - ms "2.0.0" + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" debug@^4.1.0, debug@^4.1.1: version "4.3.4" @@ -1185,36 +1677,116 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -diff@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" - integrity sha512-597ykPFhtJYaXqPq6fF7Vl1fXTKgPdLOntyxpmdzUOKiYGqK7zcnbplj5088+8qJnWdzXhyeau5iVr8HVo9dgg== +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" + integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== electron-to-chromium@^1.4.251: version "1.4.284" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expect@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" + integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== + dependencies: + "@jest/expect-utils" "^29.3.1" + jest-get-type "^29.2.0" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + +fast-json-stable-stringify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1222,7 +1794,7 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-up@^4.1.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -1260,7 +1832,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@~2.3.2: +fsevents@^2.3.2, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -1275,11 +1847,21 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -1287,19 +1869,7 @@ glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - integrity sha512-mRyN/EsN2SyNhKWykF3eEGhDpeNplMWaW18Bmh76tnOqk5TbELAVwFAYOCmKVssOYFrYvvLMguiA+NXO3ZTuVA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.0, glob@^7.2.0: +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -1316,31 +1886,21 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w== - -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" - integrity sha512-RTBwDHhNuOx4F0hqzItc/siXCasGfC4DeWcBamclWd+6jWtBaeB/SGbMkGf0eiQoW7ib8JpvOgnUsmgMHI3Mfw== - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA== - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -1348,10 +1908,28 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA== +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +import-local@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== inflight@^1.0.4: version "1.0.6" @@ -1366,6 +1944,11 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -1390,6 +1973,11 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -1402,11 +1990,432 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + +istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-report@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" + integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^3.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" + integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.2.0.tgz#b6598daa9803ea6a4dce7968e20ab380ddbee289" + integrity sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA== + dependencies: + execa "^5.0.0" + p-limit "^3.1.0" + +jest-circus@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.3.1.tgz#177d07c5c0beae8ef2937a67de68f1e17bbf1b4a" + integrity sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/expect" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^0.7.0" + is-generator-fn "^2.0.0" + jest-each "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-runtime "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + p-limit "^3.1.0" + pretty-format "^29.3.1" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-cli@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.3.1.tgz#e89dff427db3b1df50cea9a393ebd8640790416d" + integrity sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ== + dependencies: + "@jest/core" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + import-local "^3.0.2" + jest-config "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" + prompts "^2.0.1" + yargs "^17.3.1" + +jest-config@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.3.1.tgz#0bc3dcb0959ff8662957f1259947aedaefb7f3c6" + integrity sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.3.1" + "@jest/types" "^29.3.1" + babel-jest "^29.3.1" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.3.1" + jest-environment-node "^29.3.1" + jest-get-type "^29.2.0" + jest-regex-util "^29.2.0" + jest-resolve "^29.3.1" + jest-runner "^29.3.1" + jest-util "^29.3.1" + jest-validate "^29.3.1" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.3.1" + slash "^3.0.0" + strip-json-comments "^3.1.1" + +jest-diff@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" + integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.3.1" + jest-get-type "^29.2.0" + pretty-format "^29.3.1" + +jest-docblock@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.2.0.tgz#307203e20b637d97cee04809efc1d43afc641e82" + integrity sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A== + dependencies: + detect-newline "^3.0.0" + +jest-each@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.3.1.tgz#bc375c8734f1bb96625d83d1ca03ef508379e132" + integrity sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA== + dependencies: + "@jest/types" "^29.3.1" + chalk "^4.0.0" + jest-get-type "^29.2.0" + jest-util "^29.3.1" + pretty-format "^29.3.1" + +jest-environment-node@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.3.1.tgz#5023b32472b3fba91db5c799a0d5624ad4803e74" + integrity sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + jest-mock "^29.3.1" + jest-util "^29.3.1" + +jest-get-type@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" + integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== + +jest-haste-map@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.3.1.tgz#af83b4347f1dae5ee8c2fb57368dc0bb3e5af843" + integrity sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A== + dependencies: + "@jest/types" "^29.3.1" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.2.0" + jest-util "^29.3.1" + jest-worker "^29.3.1" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + +jest-leak-detector@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.3.1.tgz#95336d020170671db0ee166b75cd8ef647265518" + integrity sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA== + dependencies: + jest-get-type "^29.2.0" + pretty-format "^29.3.1" + +jest-matcher-utils@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" + integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== + dependencies: + chalk "^4.0.0" + jest-diff "^29.3.1" + jest-get-type "^29.2.0" + pretty-format "^29.3.1" + +jest-message-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" + integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.3.1" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.3.1" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.3.1.tgz#60287d92e5010979d01f218c6b215b688e0f313e" + integrity sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA== + dependencies: + "@jest/types" "^29.3.1" + "@types/node" "*" + jest-util "^29.3.1" + +jest-pnp-resolver@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +jest-regex-util@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.2.0.tgz#82ef3b587e8c303357728d0322d48bbfd2971f7b" + integrity sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA== + +jest-resolve-dependencies@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.3.1.tgz#a6a329708a128e68d67c49f38678a4a4a914c3bf" + integrity sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA== + dependencies: + jest-regex-util "^29.2.0" + jest-snapshot "^29.3.1" + +jest-resolve@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.3.1.tgz#9a4b6b65387a3141e4a40815535c7f196f1a68a7" + integrity sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.3.1" + jest-pnp-resolver "^1.2.2" + jest-util "^29.3.1" + jest-validate "^29.3.1" + resolve "^1.20.0" + resolve.exports "^1.1.0" + slash "^3.0.0" + +jest-runner@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.3.1.tgz#a92a879a47dd096fea46bb1517b0a99418ee9e2d" + integrity sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA== + dependencies: + "@jest/console" "^29.3.1" + "@jest/environment" "^29.3.1" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.2.0" + jest-environment-node "^29.3.1" + jest-haste-map "^29.3.1" + jest-leak-detector "^29.3.1" + jest-message-util "^29.3.1" + jest-resolve "^29.3.1" + jest-runtime "^29.3.1" + jest-util "^29.3.1" + jest-watcher "^29.3.1" + jest-worker "^29.3.1" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.3.1.tgz#21efccb1a66911d6d8591276a6182f520b86737a" + integrity sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A== + dependencies: + "@jest/environment" "^29.3.1" + "@jest/fake-timers" "^29.3.1" + "@jest/globals" "^29.3.1" + "@jest/source-map" "^29.2.0" + "@jest/test-result" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.3.1" + jest-message-util "^29.3.1" + jest-mock "^29.3.1" + jest-regex-util "^29.2.0" + jest-resolve "^29.3.1" + jest-snapshot "^29.3.1" + jest-util "^29.3.1" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.3.1.tgz#17bcef71a453adc059a18a32ccbd594b8cc4e45e" + integrity sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.3.1" + "@jest/transform" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/babel__traverse" "^7.0.6" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.3.1" + graceful-fs "^4.2.9" + jest-diff "^29.3.1" + jest-get-type "^29.2.0" + jest-haste-map "^29.3.1" + jest-matcher-utils "^29.3.1" + jest-message-util "^29.3.1" + jest-util "^29.3.1" + natural-compare "^1.4.0" + pretty-format "^29.3.1" + semver "^7.3.5" + +jest-util@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" + integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== + dependencies: + "@jest/types" "^29.3.1" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.3.1.tgz#d56fefaa2e7d1fde3ecdc973c7f7f8f25eea704a" + integrity sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g== + dependencies: + "@jest/types" "^29.3.1" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.2.0" + leven "^3.1.0" + pretty-format "^29.3.1" + +jest-watcher@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.3.1.tgz#3341547e14fe3c0f79f9c3a4c62dbc3fc977fd4a" + integrity sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg== + dependencies: + "@jest/test-result" "^29.3.1" + "@jest/types" "^29.3.1" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.3.1" + string-length "^4.0.1" + +jest-worker@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.3.1.tgz#e9462161017a9bb176380d721cab022661da3d6b" + integrity sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw== + dependencies: + "@types/node" "*" + jest-util "^29.3.1" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.3.1.tgz#c130c0d551ae6b5459b8963747fed392ddbde122" + integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== + dependencies: + "@jest/core" "^29.3.1" + "@jest/types" "^29.3.1" + import-local "^3.0.2" + jest-cli "^29.3.1" + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -1417,10 +2426,10 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - integrity sha512-I5YLeauH3rIaE99EE++UeH2M2gSYo8/2TqDac7oZEH6D/DSQ4Woa628Qrfj1X9/OY5Mk5VvIDQaKCDchXaKrmA== +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json5@^2.2.1: version "2.2.2" @@ -1439,6 +2448,21 @@ kefir@^3.7.3: resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.8.tgz#235932ddfbed422acebf5d7cba503035e9ea05c5" integrity sha512-xWga7QCZsR2Wjy2vNL3Kq/irT+IwxwItEWycRRlT5yhqHZK2fmEhziP+LzcJBWSTAMranGKtGTQ6lFpyJS3+jA== +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -1446,67 +2470,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - integrity sha512-t3N26QR2IdSN+gqSy9Ds9pBu/J1EAFEshKlUHpJG3rvyJOYgcELIxcIeKKfZk7sjOz11cFfzJRsyFry/JyabJQ== - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - integrity sha512-rFR6Vpm4HeCK1WPGvjZSJ+7yik8d8PVUdCJx5rT2pogG4Ve/2ZS7kfmO5l5T2o5V2mqlNIfSF5MZlr1+xOoYQQ== - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - integrity sha512-EDem6C9iQpn7fxnGdmhXmqYGjCkStmDXT4AeyB2Ph8WKbglg4aJZczNkQglj+zWXcOEEkViK8THuV2JvugW47g== - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha512-RrL9VxMEPyDMHOd9uFbvMe8X55X16/cGM5IgOKgRElQZutpX89iS6vwl64duTV1/16w5JY7tuFNXqoekmh1EmA== - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - integrity sha512-De+ZbrMu6eThFti/CSzhRvTKMgQToLxbij58LMfM8JnYDNSOjkjTCIaa8ixglOeGh2nyPlakbt5bJWJ7gvpYlQ== - -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - integrity sha512-IUfOYwDEbI8JbhW6psW+Ig01BOVK67dTSCUAbS58M0HBkPcAv/jHuxD+oJVP2tUCo3H9L6f/8GM6rxwY+oc7/w== - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg== - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - integrity sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ== - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - integrity sha512-CuBsapFjcubOGMn3VD+24HOAPxM79tH+V6ivJL3CHYjtrawauDJHUk//Yew9Hvc6e9rbCrURGk8z6PC+8WJBfQ== - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -1514,6 +2482,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -1522,53 +2497,60 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -minimatch@^3.0.2, minimatch@^3.1.1: +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q== - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA== - dependencies: - minimist "0.0.8" - -mocha@^3.2.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" - integrity sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg== - dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.8" - diff "3.2.0" - escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - he "1.1.1" - json3 "3.3.2" - lodash.create "3.1.1" - mkdirp "0.5.1" - supports-color "3.1.2" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + node-releases@^2.0.6: version "2.0.8" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" @@ -1579,6 +2561,13 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1586,6 +2575,13 @@ once@^1.3.0: dependencies: wrappy "1" +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -1593,6 +2589,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -1605,6 +2608,16 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -1615,6 +2628,11 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" @@ -1625,7 +2643,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1: +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -1635,6 +2653,40 @@ pify@^4.0.1: resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== +pirates@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +pretty-format@^29.3.1: + version "29.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" + integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== + dependencies: + "@jest/schemas" "^29.0.0" + ansi-styles "^5.0.0" + react-is "^18.0.0" + +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1700,7 +2752,24 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resolve@^1.14.2: +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve.exports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" + integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== + +resolve@^1.14.2, resolve@^1.20.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -1714,22 +2783,89 @@ semver@^5.6.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.5: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== -string-width@^4.1.0, string-width@^4.2.0: +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -1745,12 +2881,20 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" -supports-color@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - integrity sha512-F8dvPrZJtNzvDRX26eNXT4a7AecAvTGljmmnI39xEgSpbHKhQ7N0dO/NTxUExd0wuLHp4zbwYY7lvHq0aKpwrA== - dependencies: - has-flag "^1.0.0" +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== supports-color@^5.3.0: version "5.5.0" @@ -1759,11 +2903,39 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -1776,6 +2948,16 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" @@ -1812,11 +2994,34 @@ update-browserslist-db@^1.0.9: escalade "^3.1.1" picocolors "^1.0.0" +v8-to-istanbul@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" + integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^1.6.0" + +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -1826,21 +3031,48 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +write-file-atomic@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + y18n@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -1849,6 +3081,11 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + yargs@^15.0.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" @@ -1865,3 +3102,21 @@ yargs@^15.0.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.2" + +yargs@^17.3.1: + version "17.6.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" + integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -- 2.50.1.windows.1 From 4f233df064f5a6898bed1cf8a1dbd01dac179863 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Thu, 22 Dec 2022 19:31:48 +0300 Subject: [PATCH 19/47] remove `s` --- javascript/sources/entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/sources/entry.js b/javascript/sources/entry.js index a30485d3..add4e59a 100644 --- a/javascript/sources/entry.js +++ b/javascript/sources/entry.js @@ -76,7 +76,7 @@ class Size { expose(this.width, this.height); } - toString() {s + toString() { return ``; } } -- 2.50.1.windows.1 From 3352385fb02a8171cc8b8b835a36fa6709a56588 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 00:43:57 -0800 Subject: [PATCH 20/47] Move to 4 flavor build and tests --- javascript/.babelrc | 8 --- javascript/.babelrc.js | 17 +++++ javascript/.gitignore | 11 +-- javascript/.hgignore | 15 ---- javascript/CMakeLists.txt | 72 +++++++++++++++++++ javascript/Makefile | 67 ----------------- javascript/jest.config.js | 2 +- javascript/jest.setup.js | 67 +++-------------- javascript/package.json | 30 +++++--- javascript/sources/entry.js | 7 +- javascript/sources/index.asmjs.js | 21 ++++++ javascript/sources/index.wasm.js | 10 ++- javascript/sources/sync.asmjs.js | 17 +++++ .../sources/{index.asm.js => sync.wasm.js} | 6 +- javascript/tests/run-bench.js | 5 +- 15 files changed, 174 insertions(+), 181 deletions(-) delete mode 100644 javascript/.babelrc create mode 100644 javascript/.babelrc.js delete mode 100644 javascript/.hgignore create mode 100644 javascript/CMakeLists.txt delete mode 100644 javascript/Makefile create mode 100644 javascript/sources/index.asmjs.js create mode 100644 javascript/sources/sync.asmjs.js rename javascript/sources/{index.asm.js => sync.wasm.js} (71%) diff --git a/javascript/.babelrc b/javascript/.babelrc deleted file mode 100644 index 2f28ae87..00000000 --- a/javascript/.babelrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "presets": [ - ["@babel/preset-env", {"targets": "defaults"}] - ], - "plugins": [ - "@babel/plugin-transform-flow-strip-types" - ] -} diff --git a/javascript/.babelrc.js b/javascript/.babelrc.js new file mode 100644 index 00000000..88e0db11 --- /dev/null +++ b/javascript/.babelrc.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +module.exports = { + "presets": [ + ["@babel/preset-env", {"targets": "defaults"}] + ], + "plugins": [ + "@babel/plugin-transform-flow-strip-types" + ] +}; diff --git a/javascript/.gitignore b/javascript/.gitignore index 2be86e61..29751e5c 100644 --- a/javascript/.gitignore +++ b/javascript/.gitignore @@ -1,10 +1,3 @@ -node_modules - -*.gypi -!/final-flags.gypi - +/build /dist -/build/* -/sources/yoga - -npm-debug.log* +/node_modules diff --git a/javascript/.hgignore b/javascript/.hgignore deleted file mode 100644 index 81e96ec0..00000000 --- a/javascript/.hgignore +++ /dev/null @@ -1,15 +0,0 @@ -syntax:glob - -node_modules - -*.gypi -!/final-flags.gypi - -/dist -/build/* -!/build/Release -/build/Release/* -!/build/Release/nbind.js -/sources/yoga - -npm-debug.log* diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt new file mode 100644 index 00000000..4cc3f69e --- /dev/null +++ b/javascript/CMakeLists.txt @@ -0,0 +1,72 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) +project(yoga) + +file(GLOB SOURCES + ../yoga/*.cpp + ../yoga/**/*.cpp + sources/*.cc) + +include_directories(..) + +set(CXX_STANDARD, 11) + +set(EMCC_FLAGS + -flto + -fno-exceptions + -fno-rtti + -g0 + -Os + "SHELL:-s STRICT=1") + +add_compile_options( + ${EMCC_FLAGS} + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 + -std=c++11) + +add_link_options( + ${EMCC_FLAGS} + --closure 1 + --memory-init-file 0 + --no-entry + "SHELL:-s ALLOW_MEMORY_GROWTH=1" + "SHELL:-s ASSERTIONS=0" + "SHELL:-s DYNAMIC_EXECUTION=0" + "SHELL:-s ENVIRONMENT='web,node'" + "SHELL:-s EXPORT_NAME='loadYoga'" + "SHELL:-s FETCH_SUPPORT_INDEXEDDB=0" + "SHELL:-s FILESYSTEM=0" + "SHELL:-s MALLOC='emmalloc'" + "SHELL:-s MODULARIZE=1" + "SHELL:-s TEXTDECODER=0") + +link_libraries(embind) + +add_library(yogaObjLib OBJECT ${SOURCES}) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist) + +add_executable(asmjs-sync $) +target_link_options(asmjs-sync PUBLIC + "SHELL:-s WASM=0" + "SHELL:-s WASM_ASYNC_COMPILATION=0") + +add_executable(asmjs-async $) +target_link_options(asmjs-async PUBLIC + "SHELL:-s WASM=0" + "SHELL:-s WASM_ASYNC_COMPILATION=1") + +add_executable(wasm-sync $) +target_link_options(wasm-sync PUBLIC + "SHELL:-s WASM=1" + "SHELL:-s WASM_ASYNC_COMPILATION=0") + +add_executable(wasm-async $) +target_link_options(wasm-async PUBLIC + "SHELL:-s WASM=1" + "SHELL:-s WASM_ASYNC_COMPILATION=1") diff --git a/javascript/Makefile b/javascript/Makefile deleted file mode 100644 index c74291fa..00000000 --- a/javascript/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -CXX=em++ - -SOURCES=\ - sources/yoga/*.cpp \ - sources/yoga/**/*.cpp \ - sources/*.cc - -CXXFLAGS=\ - -Isources \ - -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ - -std=c++11 \ - -g0 \ - -Os \ - -flto \ - -fno-exceptions \ - -fno-rtti \ - -EMCCFLAGS=\ - --closure 1 \ - --memory-init-file 0 \ - --no-entry - -EMCCOPTS=\ - -s ALLOW_MEMORY_GROWTH=1 \ - -s ASSERTIONS=0 \ - -s DEFAULT_TO_CXX=1 \ - -s DYNAMIC_EXECUTION=0 \ - -s ENVIRONMENT="web,node" \ - -s EXPORT_NAME="yoga" \ - -s FETCH_SUPPORT_INDEXEDDB=0 \ - -s FILESYSTEM=0 \ - -s MALLOC="emmalloc" \ - -s MODULARIZE=1 \ - -s STRICT=1 \ - -s TEXTDECODER=0 \ - -s USE_ES6_IMPORT_META=0 - -LDLIBS=\ - -lembind - -all: clean dir asm wasm - -asm: - $(CXX) $(SOURCES) \ - $(INCLUDE) \ - $(CXXFLAGS) \ - $(EMCCFLAGS) \ - $(LDLIBS) \ - $(EMCCOPTS) \ - -s WASM=0 \ - -o dist/asm.js - -wasm: - $(CXX) $(SOURCES) \ - $(INCLUDE) \ - $(CXXFLAGS) \ - $(EMCCFLAGS) \ - $(LDLIBS) \ - $(EMCCOPTS) \ - -s WASM=1 \ - -o dist/wasm.js - -clean: - rm -rf dist - -dir: - mkdir -p dist diff --git a/javascript/jest.config.js b/javascript/jest.config.js index 8129bc93..2e962810 100644 --- a/javascript/jest.config.js +++ b/javascript/jest.config.js @@ -8,7 +8,7 @@ */ module.exports = { - setupFiles: ["./jest.setup.js"], + setupFiles: ["./jest.setup.js", "./tests/tools.js"], testRegex: '/tests/Facebook.Yoga/.*\\.js$', watchman: false, } diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index 5ee9275e..85c6582d 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -8,62 +8,13 @@ */ module.exports = async () => { - global.Yoga = process.env['WASM'] - ? await require("./dist/index.wasm").initialize() - : await require("./dist/index.asm").initialize(); - - global.getMeasureCounter = function(Yoga, cb, staticWidth, staticHeight) { - var counter = 0; - - return { - inc: function(width, widthMode, height, heightMode) { - counter += 1; - - return cb - ? cb(width, widthMode, height, heightMode) - : {width: staticWidth, height: staticHeight}; - }, - - get: function() { - return counter; - }, - }; - }; - - global.getMeasureCounterMax = function(Yoga) { - return getMeasureCounter(Yoga, function( - width, - widthMode, - height, - heightMode, - ) { - var measuredWidth = widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; - - return {width: measuredWidth, height: measuredHeight}; - }); - }; - - global.getMeasureCounterMin = function(Yoga) { - return getMeasureCounter(Yoga, function( - width, - widthMode, - height, - heightMode, - ) { - var measuredWidth = - widthMode === Yoga.MEASURE_MODE_UNDEFINED || - (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) - ? 10 - : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED || - (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) - ? 10 - : height; - - return {width: measuredWidth, height: measuredHeight}; - }); - }; + if (process.env['SYNC'] && process.env['WASM']) { + global.Yoga = require("./dist/sync.wasm"); + } else if (process.env['SYNC']) { + global.Yoga = require("./dist/sync.asmjs"); + } else if (process.env['WASM']) { + global.Yoga = await require("./dist/index.wasm").load(); + } else { + global.Yoga = await require("./dist/index.asmjs").load(); + } } diff --git a/javascript/package.json b/javascript/package.json index 539534b7..a291941a 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -11,19 +11,31 @@ ".": { "browser": "./dist/index.wasm.js", "node": "./dist/index.wasm.js", - "react-native": "./dist/index.asm.js", - "default": "./dist/index.asm.js" + "react-native": "./dist/index.asmjs.js", + "default": "./dist/index.asmjs.js" + }, + "./sync": { + "browser": "./dist/sync.asmks.js", + "node": "./dist/sync.wasm.js", + "react-native": "./dist/sync.asmjs.js", + "default": "./dist/sync.asmjs.js" } }, + "files": [ + "dist/**", + "sources/**" + ], "scripts": { - "is-monolithic": "test \"$(basename \"$(pwd)\")\" = javascript", - "copy-sources": "! npm -s run is-monolithic || (rsync -r --checksum --delete ../yoga/ sources/yoga/)", - "build": "npm run copy-sources && make && npm run build:js", - "test": "yarn test:asm && yarn test:wasm", - "test:asm": "jest", + "build": "yarn build:native && yarn build:js", + "build:native": "yarn build:project && cmake --build build", + "build:project": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", + "build:js": "babel sources --source-maps --out-dir dist && flow-copy-source sources dist", + "test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync", + "test:asmjs": "jest", + "test:asmjs-sync": "SYNC=1 jest", "test:wasm": "WASM=1 jest", - "benchmark": "npm run build && node tests/run-bench $(find tests/Benchmarks -name '*.js')", - "build:js": "babel sources --source-maps --out-dir dist && flow-copy-source sources dist" + "test:wasm-sync": "WASM=1 SYNC=1 jest", + "benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')" }, "devDependencies": { "@babel/cli": "^7.20.7", diff --git a/javascript/sources/entry.js b/javascript/sources/entry.js index add4e59a..0b9a3545 100644 --- a/javascript/sources/entry.js +++ b/javascript/sources/entry.js @@ -8,7 +8,6 @@ * @format */ - const CONSTANTS = require('./YGEnums'); import type { Yoga$Edge, @@ -238,7 +237,7 @@ type Yoga = { ...typeof CONSTANTS, }; -function wrapLib(lib: any): Yoga { +module.exports = function wrapLib(lib: any): Yoga { function patch(prototype, name, fn) { let original = prototype[name]; @@ -378,7 +377,3 @@ function wrapLib(lib: any): Yoga { ...CONSTANTS, }; }; - -module.exports = (libPromise: any) => ({ - initialize: () => libPromise.then(wrapLib) -}: YogaConstructor); diff --git a/javascript/sources/index.asmjs.js b/javascript/sources/index.asmjs.js new file mode 100644 index 00000000..ce3710cd --- /dev/null +++ b/javascript/sources/index.asmjs.js @@ -0,0 +1,21 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +const wrapLib = require('./entry'); +const loadYoga = require('./asmjs-async'); + +module.exports = { + load: () => { + return loadYoga().then(wrapLib); + } +} + +export type * from './YGEnums.js'; +export type * from './entry'; diff --git a/javascript/sources/index.wasm.js b/javascript/sources/index.wasm.js index 19f00053..d218d310 100644 --- a/javascript/sources/index.wasm.js +++ b/javascript/sources/index.wasm.js @@ -8,10 +8,14 @@ * @format */ -const entry = require('./entry'); -const yoga = require('./wasm'); +const wrapLib = require('./entry'); +const loadYoga = require('./wasm-async'); -module.exports = entry(yoga()); +module.exports = { +load: () => { + return loadYoga().then(wrapLib); +} +} export type * from './YGEnums.js'; export type * from './entry'; diff --git a/javascript/sources/sync.asmjs.js b/javascript/sources/sync.asmjs.js new file mode 100644 index 00000000..b967e046 --- /dev/null +++ b/javascript/sources/sync.asmjs.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +const wrapLib = require('./entry'); +const loadYoga = require('./asmjs-sync'); + +module.exports = wrapLib(loadYoga()); + +export type * from './YGEnums.js'; +export type * from './entry'; diff --git a/javascript/sources/index.asm.js b/javascript/sources/sync.wasm.js similarity index 71% rename from javascript/sources/index.asm.js rename to javascript/sources/sync.wasm.js index 6b6eff65..196d7a08 100644 --- a/javascript/sources/index.asm.js +++ b/javascript/sources/sync.wasm.js @@ -8,10 +8,10 @@ * @format */ -const entry = require('./entry'); -const yoga = require('./asm'); +const wrapLib = require('./entry'); +const loadYoga = require('./wasm-sync'); -module.exports = entry(yoga()); +module.exports = wrapLib(loadYoga()); export type * from './YGEnums.js'; export type * from './entry'; diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index cc2946f9..0475b5e0 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node /** * Copyright (c) Meta Platforms, Inc. and affiliates. * @@ -21,12 +22,12 @@ let testFiles = process.argv.slice(2).map(file => { let testResults = new Map(); -for (let type of ['asm', 'wasm']) { +for (let type of ['asmjs', 'wasm']) { for (let file of testFiles) { vm.runInNewContext( file, Object.assign(Object.create(global), { - Yoga: require(type === 'asm' ? '../dist/index.asm' : '../dist/index.wasm'), + Yoga: require(type === 'asmjs' ? '../dist/sync.asmjs' : '../dist/sync.wasm'), YGBENCHMARK: function(name, fn) { let testEntry = testResults.get(name); -- 2.50.1.windows.1 From aaadf57b195963b54fdc3d80f31c491dcb7d4438 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 02:43:45 -0800 Subject: [PATCH 21/47] Add TypeScript declarations --- enums.py | 29 ++- javascript/.babelrc.js | 3 - javascript/package.json | 8 +- javascript/sources/YGEnums.d.ts | 190 +++++++++++++++ javascript/sources/YGEnums.js | 104 +------- javascript/sources/entry.js | 379 ------------------------------ javascript/sources/index.asmjs.js | 11 +- javascript/sources/index.d.ts | 15 ++ javascript/sources/index.wasm.js | 11 +- javascript/sources/sync.asmjs.js | 8 +- javascript/sources/sync.d.ts | 16 ++ javascript/sources/sync.wasm.js | 8 +- javascript/sources/wrapAsm.d.ts | 168 +++++++++++++ javascript/sources/wrapAsm.js | 145 ++++++++++++ javascript/yarn.lock | 130 +--------- 15 files changed, 576 insertions(+), 649 deletions(-) create mode 100644 javascript/sources/YGEnums.d.ts delete mode 100644 javascript/sources/entry.js create mode 100644 javascript/sources/index.d.ts create mode 100644 javascript/sources/sync.d.ts create mode 100644 javascript/sources/wrapAsm.d.ts create mode 100644 javascript/sources/wrapAsm.js diff --git a/enums.py b/enums.py index 03152072..4cd2a64d 100644 --- a/enums.py +++ b/enums.py @@ -224,9 +224,7 @@ for name, values in sorted(ENUMS.items()): # write out javascript file with open(root + "/javascript/sources/YGEnums.js", "w") as f: f.write(get_license("js")) - f.write("// @flow\n") - f.write("// @format\n") - f.write("const CONSTANTS = {\n") + f.write("module.exports = {\n") items = sorted(ENUMS.items()) for name, values in items: f.write(" %s_COUNT: %s,\n" % (to_java_upper(name), len(values))) @@ -248,12 +246,32 @@ with open(root + "/javascript/sources/YGEnums.js", "w") as f: f.write("\n") f.write("};\n") +with open(root + "/javascript/sources/YGEnums.d.ts", "w") as f: + f.write(get_license("js")) + for name, values in sorted(ENUMS.items()): - f.write("export type Yoga${} =\n".format(name)) + base = 0 + for value in values: + if isinstance(value, tuple): + f.write( + "export const %s_%s: %d;\n" + % (to_java_upper(name), to_java_upper(value[0]), value[1]) + ) + base = value[1] + 1 + else: + f.write( + "export const %s_%s: %d;\n" % (to_java_upper(name), to_java_upper(value), base) + ) + base += 1 + + f.write("\n") + + for name, values in sorted(ENUMS.items()): + f.write("export type {} =\n".format(name)) for value in values: unpackedValue = value[0] if isinstance(value, tuple) else value f.write( - " | typeof CONSTANTS.{}_{}".format( + " | typeof {}_{}".format( to_java_upper(name), to_java_upper(unpackedValue) ) ) @@ -263,4 +281,3 @@ with open(root + "/javascript/sources/YGEnums.js", "w") as f: f.write("\n") f.write("\n") - f.write("module.exports = CONSTANTS;\n") diff --git a/javascript/.babelrc.js b/javascript/.babelrc.js index 88e0db11..6a57844c 100644 --- a/javascript/.babelrc.js +++ b/javascript/.babelrc.js @@ -11,7 +11,4 @@ module.exports = { "presets": [ ["@babel/preset-env", {"targets": "defaults"}] ], - "plugins": [ - "@babel/plugin-transform-flow-strip-types" - ] }; diff --git a/javascript/package.json b/javascript/package.json index a291941a..db90ae73 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -27,9 +27,9 @@ ], "scripts": { "build": "yarn build:native && yarn build:js", - "build:native": "yarn build:project && cmake --build build", - "build:project": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", - "build:js": "babel sources --source-maps --out-dir dist && flow-copy-source sources dist", + "build:native": "yarn build:native-project && cmake --build build", + "build:native-project": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", + "build:js": "babel sources --source-maps --out-dir dist && cp -r sources/*.d.ts dist", "test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync", "test:asmjs": "jest", "test:asmjs-sync": "SYNC=1 jest", @@ -40,9 +40,7 @@ "devDependencies": { "@babel/cli": "^7.20.7", "@babel/core": "^7.20.7", - "@babel/plugin-transform-flow-strip-types": "^7.19.0", "@babel/preset-env": "^7.20.2", - "flow-copy-source": "^2.0.7", "jest": "^29.3.1" } } diff --git a/javascript/sources/YGEnums.d.ts b/javascript/sources/YGEnums.d.ts new file mode 100644 index 00000000..1230c1c7 --- /dev/null +++ b/javascript/sources/YGEnums.d.ts @@ -0,0 +1,190 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// @generated by enums.py + +export const ALIGN_AUTO: 0; +export const ALIGN_FLEX_START: 1; +export const ALIGN_CENTER: 2; +export const ALIGN_FLEX_END: 3; +export const ALIGN_STRETCH: 4; +export const ALIGN_BASELINE: 5; +export const ALIGN_SPACE_BETWEEN: 6; +export const ALIGN_SPACE_AROUND: 7; + +export const DIMENSION_WIDTH: 0; +export const DIMENSION_HEIGHT: 1; + +export const DIRECTION_INHERIT: 0; +export const DIRECTION_LTR: 1; +export const DIRECTION_RTL: 2; + +export const DISPLAY_FLEX: 0; +export const DISPLAY_NONE: 1; + +export const EDGE_LEFT: 0; +export const EDGE_TOP: 1; +export const EDGE_RIGHT: 2; +export const EDGE_BOTTOM: 3; +export const EDGE_START: 4; +export const EDGE_END: 5; +export const EDGE_HORIZONTAL: 6; +export const EDGE_VERTICAL: 7; +export const EDGE_ALL: 8; + +export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0; + +export const FLEX_DIRECTION_COLUMN: 0; +export const FLEX_DIRECTION_COLUMN_REVERSE: 1; +export const FLEX_DIRECTION_ROW: 2; +export const FLEX_DIRECTION_ROW_REVERSE: 3; + +export const GUTTER_COLUMN: 0; +export const GUTTER_ROW: 1; +export const GUTTER_ALL: 2; + +export const JUSTIFY_FLEX_START: 0; +export const JUSTIFY_CENTER: 1; +export const JUSTIFY_FLEX_END: 2; +export const JUSTIFY_SPACE_BETWEEN: 3; +export const JUSTIFY_SPACE_AROUND: 4; +export const JUSTIFY_SPACE_EVENLY: 5; + +export const LOG_LEVEL_ERROR: 0; +export const LOG_LEVEL_WARN: 1; +export const LOG_LEVEL_INFO: 2; +export const LOG_LEVEL_DEBUG: 3; +export const LOG_LEVEL_VERBOSE: 4; +export const LOG_LEVEL_FATAL: 5; + +export const MEASURE_MODE_UNDEFINED: 0; +export const MEASURE_MODE_EXACTLY: 1; +export const MEASURE_MODE_AT_MOST: 2; + +export const NODE_TYPE_DEFAULT: 0; +export const NODE_TYPE_TEXT: 1; + +export const OVERFLOW_VISIBLE: 0; +export const OVERFLOW_HIDDEN: 1; +export const OVERFLOW_SCROLL: 2; + +export const POSITION_TYPE_STATIC: 0; +export const POSITION_TYPE_RELATIVE: 1; +export const POSITION_TYPE_ABSOLUTE: 2; + +export const PRINT_OPTIONS_LAYOUT: 1; +export const PRINT_OPTIONS_STYLE: 2; +export const PRINT_OPTIONS_CHILDREN: 4; + +export const UNIT_UNDEFINED: 0; +export const UNIT_POINT: 1; +export const UNIT_PERCENT: 2; +export const UNIT_AUTO: 3; + +export const WRAP_NO_WRAP: 0; +export const WRAP_WRAP: 1; +export const WRAP_WRAP_REVERSE: 2; + +export type Align = + | typeof ALIGN_AUTO + | typeof ALIGN_FLEX_START + | typeof ALIGN_CENTER + | typeof ALIGN_FLEX_END + | typeof ALIGN_STRETCH + | typeof ALIGN_BASELINE + | typeof ALIGN_SPACE_BETWEEN + | typeof ALIGN_SPACE_AROUND; + +export type Dimension = + | typeof DIMENSION_WIDTH + | typeof DIMENSION_HEIGHT; + +export type Direction = + | typeof DIRECTION_INHERIT + | typeof DIRECTION_LTR + | typeof DIRECTION_RTL; + +export type Display = + | typeof DISPLAY_FLEX + | typeof DISPLAY_NONE; + +export type Edge = + | typeof EDGE_LEFT + | typeof EDGE_TOP + | typeof EDGE_RIGHT + | typeof EDGE_BOTTOM + | typeof EDGE_START + | typeof EDGE_END + | typeof EDGE_HORIZONTAL + | typeof EDGE_VERTICAL + | typeof EDGE_ALL; + +export type ExperimentalFeature = + | typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; + +export type FlexDirection = + | typeof FLEX_DIRECTION_COLUMN + | typeof FLEX_DIRECTION_COLUMN_REVERSE + | typeof FLEX_DIRECTION_ROW + | typeof FLEX_DIRECTION_ROW_REVERSE; + +export type Gutter = + | typeof GUTTER_COLUMN + | typeof GUTTER_ROW + | typeof GUTTER_ALL; + +export type Justify = + | typeof JUSTIFY_FLEX_START + | typeof JUSTIFY_CENTER + | typeof JUSTIFY_FLEX_END + | typeof JUSTIFY_SPACE_BETWEEN + | typeof JUSTIFY_SPACE_AROUND + | typeof JUSTIFY_SPACE_EVENLY; + +export type LogLevel = + | typeof LOG_LEVEL_ERROR + | typeof LOG_LEVEL_WARN + | typeof LOG_LEVEL_INFO + | typeof LOG_LEVEL_DEBUG + | typeof LOG_LEVEL_VERBOSE + | typeof LOG_LEVEL_FATAL; + +export type MeasureMode = + | typeof MEASURE_MODE_UNDEFINED + | typeof MEASURE_MODE_EXACTLY + | typeof MEASURE_MODE_AT_MOST; + +export type NodeType = + | typeof NODE_TYPE_DEFAULT + | typeof NODE_TYPE_TEXT; + +export type Overflow = + | typeof OVERFLOW_VISIBLE + | typeof OVERFLOW_HIDDEN + | typeof OVERFLOW_SCROLL; + +export type PositionType = + | typeof POSITION_TYPE_STATIC + | typeof POSITION_TYPE_RELATIVE + | typeof POSITION_TYPE_ABSOLUTE; + +export type PrintOptions = + | typeof PRINT_OPTIONS_LAYOUT + | typeof PRINT_OPTIONS_STYLE + | typeof PRINT_OPTIONS_CHILDREN; + +export type Unit = + | typeof UNIT_UNDEFINED + | typeof UNIT_POINT + | typeof UNIT_PERCENT + | typeof UNIT_AUTO; + +export type Wrap = + | typeof WRAP_NO_WRAP + | typeof WRAP_WRAP + | typeof WRAP_WRAP_REVERSE; + diff --git a/javascript/sources/YGEnums.js b/javascript/sources/YGEnums.js index 96905ce4..6d7df977 100644 --- a/javascript/sources/YGEnums.js +++ b/javascript/sources/YGEnums.js @@ -7,9 +7,7 @@ // @generated by enums.py -// @flow -// @format -const CONSTANTS = { +module.exports = { ALIGN_COUNT: 8, ALIGN_AUTO: 0, ALIGN_FLEX_START: 1, @@ -109,103 +107,3 @@ const CONSTANTS = { WRAP_WRAP: 1, WRAP_WRAP_REVERSE: 2, }; -export type Yoga$Align = - | typeof CONSTANTS.ALIGN_AUTO - | typeof CONSTANTS.ALIGN_FLEX_START - | typeof CONSTANTS.ALIGN_CENTER - | typeof CONSTANTS.ALIGN_FLEX_END - | typeof CONSTANTS.ALIGN_STRETCH - | typeof CONSTANTS.ALIGN_BASELINE - | typeof CONSTANTS.ALIGN_SPACE_BETWEEN - | typeof CONSTANTS.ALIGN_SPACE_AROUND; - -export type Yoga$Dimension = - | typeof CONSTANTS.DIMENSION_WIDTH - | typeof CONSTANTS.DIMENSION_HEIGHT; - -export type Yoga$Direction = - | typeof CONSTANTS.DIRECTION_INHERIT - | typeof CONSTANTS.DIRECTION_LTR - | typeof CONSTANTS.DIRECTION_RTL; - -export type Yoga$Display = - | typeof CONSTANTS.DISPLAY_FLEX - | typeof CONSTANTS.DISPLAY_NONE; - -export type Yoga$Edge = - | typeof CONSTANTS.EDGE_LEFT - | typeof CONSTANTS.EDGE_TOP - | typeof CONSTANTS.EDGE_RIGHT - | typeof CONSTANTS.EDGE_BOTTOM - | typeof CONSTANTS.EDGE_START - | typeof CONSTANTS.EDGE_END - | typeof CONSTANTS.EDGE_HORIZONTAL - | typeof CONSTANTS.EDGE_VERTICAL - | typeof CONSTANTS.EDGE_ALL; - -export type Yoga$ExperimentalFeature = - | typeof CONSTANTS.EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; - -export type Yoga$FlexDirection = - | typeof CONSTANTS.FLEX_DIRECTION_COLUMN - | typeof CONSTANTS.FLEX_DIRECTION_COLUMN_REVERSE - | typeof CONSTANTS.FLEX_DIRECTION_ROW - | typeof CONSTANTS.FLEX_DIRECTION_ROW_REVERSE; - -export type Yoga$Gutter = - | typeof CONSTANTS.GUTTER_COLUMN - | typeof CONSTANTS.GUTTER_ROW - | typeof CONSTANTS.GUTTER_ALL; - -export type Yoga$Justify = - | typeof CONSTANTS.JUSTIFY_FLEX_START - | typeof CONSTANTS.JUSTIFY_CENTER - | typeof CONSTANTS.JUSTIFY_FLEX_END - | typeof CONSTANTS.JUSTIFY_SPACE_BETWEEN - | typeof CONSTANTS.JUSTIFY_SPACE_AROUND - | typeof CONSTANTS.JUSTIFY_SPACE_EVENLY; - -export type Yoga$LogLevel = - | typeof CONSTANTS.LOG_LEVEL_ERROR - | typeof CONSTANTS.LOG_LEVEL_WARN - | typeof CONSTANTS.LOG_LEVEL_INFO - | typeof CONSTANTS.LOG_LEVEL_DEBUG - | typeof CONSTANTS.LOG_LEVEL_VERBOSE - | typeof CONSTANTS.LOG_LEVEL_FATAL; - -export type Yoga$MeasureMode = - | typeof CONSTANTS.MEASURE_MODE_UNDEFINED - | typeof CONSTANTS.MEASURE_MODE_EXACTLY - | typeof CONSTANTS.MEASURE_MODE_AT_MOST; - -export type Yoga$NodeType = - | typeof CONSTANTS.NODE_TYPE_DEFAULT - | typeof CONSTANTS.NODE_TYPE_TEXT; - -export type Yoga$Overflow = - | typeof CONSTANTS.OVERFLOW_VISIBLE - | typeof CONSTANTS.OVERFLOW_HIDDEN - | typeof CONSTANTS.OVERFLOW_SCROLL; - -export type Yoga$PositionType = - | typeof CONSTANTS.POSITION_TYPE_STATIC - | typeof CONSTANTS.POSITION_TYPE_RELATIVE - | typeof CONSTANTS.POSITION_TYPE_ABSOLUTE; - -export type Yoga$PrintOptions = - | typeof CONSTANTS.PRINT_OPTIONS_LAYOUT - | typeof CONSTANTS.PRINT_OPTIONS_STYLE - | typeof CONSTANTS.PRINT_OPTIONS_CHILDREN; - -export type Yoga$Unit = - | typeof CONSTANTS.UNIT_UNDEFINED - | typeof CONSTANTS.UNIT_POINT - | typeof CONSTANTS.UNIT_PERCENT - | typeof CONSTANTS.UNIT_AUTO; - -export type Yoga$Wrap = - | typeof CONSTANTS.WRAP_NO_WRAP - | typeof CONSTANTS.WRAP_WRAP - | typeof CONSTANTS.WRAP_WRAP_REVERSE; - -module.exports = CONSTANTS; diff --git a/javascript/sources/entry.js b/javascript/sources/entry.js deleted file mode 100644 index 0b9a3545..00000000 --- a/javascript/sources/entry.js +++ /dev/null @@ -1,379 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -const CONSTANTS = require('./YGEnums'); -import type { - Yoga$Edge, - Yoga$Wrap, - Yoga$Align, - Yoga$FlexDirection, - Yoga$Gutter, - Yoga$Direction, - Yoga$PositionType, - Yoga$Overflow, - Yoga$Justify, - Yoga$Display, - Yoga$ExperimentalFeature, -} from './YGEnums'; - -class Layout { - left: number; - right: number; - top: number; - bottom: number; - width: number; - height: number; - - constructor(left, right, top, bottom, width, height) { - this.left = left; - this.right = right; - this.top = top; - this.bottom = bottom; - this.width = width; - this.height = height; - } - - fromJS(expose) { - expose( - this.left, - this.right, - this.top, - this.bottom, - this.width, - this.height, - ); - } - - toString() { - return ``; - } -} - -class Size { - static fromJS({width, height}) { - return new Size(width, height); - } - - width: number; - height: number; - - constructor(width, height) { - this.width = width; - this.height = height; - } - - fromJS(expose) { - expose(this.width, this.height); - } - - toString() { - return ``; - } -} - -class Value { - unit: number; - value: number; - - constructor(unit, value) { - this.unit = unit; - this.value = value; - } - - fromJS(expose) { - expose(this.unit, this.value); - } - - toString() { - switch (this.unit) { - case CONSTANTS.UNIT_POINT: - return String(this.value); - case CONSTANTS.UNIT_PERCENT: - return `${this.value}%`; - case CONSTANTS.UNIT_AUTO: - return 'auto'; - default: { - return `${this.value}?`; - } - } - } - - valueOf() { - return this.value; - } -} - -export type Yoga$Config = { - isExperimentalFeatureEnabled(feature: Yoga$ExperimentalFeature): boolean, - setExperimentalFeatureEnabled( - feature: Yoga$ExperimentalFeature, - enabled: boolean, - ): void, - setPointScaleFactor(factor: number): void, -}; - -export type Yoga$Node = { - calculateLayout( - width?: number, - height?: number, - direction?: Yoga$Direction, - ): void, - copyStyle(node: Yoga$Node): void, - free(): void, - freeRecursive(): void, - getAlignContent(): Yoga$Align, - getAlignItems(): Yoga$Align, - getAlignSelf(): Yoga$Align, - getAspectRatio(): number, - getBorder(edge: Yoga$Edge): number, - getChild(index: number): Yoga$Node, - getChildCount(): number, - getComputedBorder(edge: Yoga$Edge): number, - getComputedBottom(): number, - getComputedHeight(): number, - getComputedLayout(): Layout, - getComputedLeft(): number, - getComputedMargin(edge: Yoga$Edge): number, - getComputedPadding(edge: Yoga$Edge): number, - getComputedRight(): number, - getComputedTop(): number, - getComputedWidth(): number, - getDisplay(): Yoga$Display, - getFlexBasis(): number, - getFlexDirection(): Yoga$FlexDirection, - getFlexGrow(): number, - getFlexShrink(): number, - getFlexWrap(): Yoga$Wrap, - getHeight(): Value, - getJustifyContent(): Yoga$Justify, - getGap(gutter: Yoga$Gutter): Value, - getMargin(edge: Yoga$Edge): Value, - getMaxHeight(): Value, - getMaxWidth(): Value, - getMinHeight(): Value, - getMinWidth(): Value, - getOverflow(): Yoga$Overflow, - getPadding(edge: Yoga$Edge): Value, - getParent(): ?Yoga$Node, - getPosition(edge: Yoga$Edge): Value, - getPositionType(): Yoga$PositionType, - getWidth(): Value, - insertChild(child: Yoga$Node, index: number): void, - isDirty(): boolean, - markDirty(): void, - removeChild(child: Yoga$Node): void, - reset(): void, - setAlignContent(alignContent: Yoga$Align): void, - setAlignItems(alignItems: Yoga$Align): void, - setAlignSelf(alignSelf: Yoga$Align): void, - setAspectRatio(aspectRatio: number): void, - setBorder(edge: Yoga$Edge, borderWidth: number): void, - setDisplay(display: Yoga$Display): void, - setFlex(flex: number): void, - setFlexBasis(flexBasis: number | string): void, - setFlexBasisPercent(flexBasis: number): void, - setFlexBasisAuto(): void, - setFlexDirection(flexDirection: Yoga$FlexDirection): void, - setFlexGrow(flexGrow: number): void, - setFlexShrink(flexShrink: number): void, - setFlexWrap(flexWrap: Yoga$Wrap): void, - setHeight(height: number | string): void, - setHeightAuto(): void, - setHeightPercent(height: number): void, - setJustifyContent(justifyContent: Yoga$Justify): void, - setGap(gutter: Yoga$Gutter, gapLength: number): Value, - setMargin(edge: Yoga$Edge, margin: number): void, - setMarginAuto(edge: Yoga$Edge): void, - setMarginPercent(edge: Yoga$Edge, margin: number): void, - setMaxHeight(maxHeight: number | string): void, - setMaxHeightPercent(maxHeight: number): void, - setMaxWidth(maxWidth: number | string): void, - setMaxWidthPercent(maxWidth: number): void, - setMeasureFunc(measureFunc: ?Function): void, - setMinHeight(minHeight: number | string): void, - setMinHeightPercent(minHeight: number): void, - setMinWidth(minWidth: number | string): void, - setMinWidthPercent(minWidth: number): void, - setOverflow(overflow: Yoga$Overflow): void, - setPadding(edge: Yoga$Edge, padding: number | string): void, - setPaddingPercent(edge: Yoga$Edge, padding: number): void, - setPosition(edge: Yoga$Edge, position: number | string): void, - setPositionPercent(edge: Yoga$Edge, position: number): void, - setPositionType(positionType: Yoga$PositionType): void, - setWidth(width: number | string): void, - setWidthAuto(): void, - setWidthPercent(width: number): void, - unsetMeasureFun(): void, -}; - -type YogaConstructor = { - initialize: () => Promise; -} - -type Yoga = { - Config: { - create(): Yoga$Config, - destroy(config: Yoga$Config): any, - }, - Node: { - create(): Yoga$Node, - createDefault(): Yoga$Node, - createWithConfig(config: Yoga$Config): Yoga$Node, - destroy(node: Yoga$Node): any, - }, - Layout: Layout, - Size: Size, - Value: Value, - getInstanceCount(): number, - ...typeof CONSTANTS, -}; - -module.exports = function wrapLib(lib: any): Yoga { - function patch(prototype, name, fn) { - let original = prototype[name]; - - prototype[name] = function(...args) { - return fn.call(this, original, ...args); - }; - } - - for (let fnName of [ - 'setPosition', - 'setMargin', - 'setFlexBasis', - 'setWidth', - 'setHeight', - 'setMinWidth', - 'setMinHeight', - 'setMaxWidth', - 'setMaxHeight', - 'setPadding', - ]) { - let methods = { - [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName], - [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`], - [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`], - }; - - patch(lib.Node.prototype, fnName, function(original, ...args) { - // We patch all these functions to add support for the following calls: - // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto") - - let value = args.pop(); - let unit, asNumber; - - if (value === 'auto') { - unit = CONSTANTS.UNIT_AUTO; - asNumber = undefined; - } else if (value instanceof Value) { - unit = value.unit; - asNumber = value.valueOf(); - } else { - unit = - typeof value === 'string' && value.endsWith('%') - ? CONSTANTS.UNIT_PERCENT - : CONSTANTS.UNIT_POINT; - asNumber = parseFloat(value); - if (!Number.isNaN(value) && Number.isNaN(asNumber)) { - throw new Error(`Invalid value ${value} for ${fnName}`); - } - } - - if (!methods[unit]) - throw new Error( - `Failed to execute "${fnName}": Unsupported unit '${value}'`, - ); - - if (asNumber !== undefined) { - return methods[unit].call(this, ...args, asNumber); - } else { - return methods[unit].call(this, ...args); - } - }); - } - - function wrapMeasureFunction(measureFunction) { - return lib.MeasureCallback.implement({ measure: measureFunction }) - } - - patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) { - original.call(this, wrapMeasureFunction(measureFunc)) - }) - - function wrapDirtiedFunc(dirtiedFunction) { - return lib.DirtiedCallback.implement({ dirtied: dirtiedFunction }) - } - - patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) { - original.call(this, wrapDirtiedFunc(dirtiedFunc)) - }) - - patch(lib.Config.prototype, 'free', function() { - // Since we handle the memory allocation ourselves (via lib.Config.create), - // we also need to handle the deallocation - lib.Config.destroy(this); - }); - - patch(lib.Node, 'create', function(_, config) { - // We decide the constructor we want to call depending on the parameters - return config - ? lib.Node.createWithConfig(config) - : lib.Node.createDefault(); - }); - - patch(lib.Node.prototype, 'free', function() { - // Since we handle the memory allocation ourselves (via lib.Node.create), - // we also need to handle the deallocation - lib.Node.destroy(this); - }); - - patch(lib.Node.prototype, 'freeRecursive', function() { - for (let t = 0, T = this.getChildCount(); t < T; ++t) { - this.getChild(0).freeRecursive(); - } - this.free(); - }); - - patch(lib.Node.prototype, 'setMeasureFunc', function(original, measureFunc) { - // This patch is just a convenience patch, since it helps write more - // idiomatic source code (such as .setMeasureFunc(null)) - // We also automatically convert the return value of the measureFunc - // to a Size object, so that we can return anything that has .width and - // .height properties - if (measureFunc) { - return original.call(this, (...args) => - Size.fromJS(measureFunc(...args)), - ); - } else { - return this.unsetMeasureFunc(); - } - }); - - patch(lib.Node.prototype, 'calculateLayout', function( - original, - width = NaN, - height = NaN, - direction = CONSTANTS.DIRECTION_LTR, - ) { - // Just a small patch to add support for the function default parameters - return original.call(this, width, height, direction); - }); - - return { - Config: lib.Config, - Node: lib.Node, - Layout: Layout, - Size: Size, - Value: Value, - ...CONSTANTS, - }; -}; diff --git a/javascript/sources/index.asmjs.js b/javascript/sources/index.asmjs.js index ce3710cd..ca89851c 100644 --- a/javascript/sources/index.asmjs.js +++ b/javascript/sources/index.asmjs.js @@ -4,18 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow * @format */ -const wrapLib = require('./entry'); +const wrapAsm = require('./wrapAsm'); const loadYoga = require('./asmjs-async'); module.exports = { - load: () => { - return loadYoga().then(wrapLib); - } + load: () => loadYoga().then(wrapAsm), + ...require('./YGEnums'), } - -export type * from './YGEnums.js'; -export type * from './entry'; diff --git a/javascript/sources/index.d.ts b/javascript/sources/index.d.ts new file mode 100644 index 00000000..7340238a --- /dev/null +++ b/javascript/sources/index.d.ts @@ -0,0 +1,15 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import type {Yoga} from './wrapAsm'; + +export * from './YGEnums'; +export * from './wrapAsm'; + +export function load(): Promise; diff --git a/javascript/sources/index.wasm.js b/javascript/sources/index.wasm.js index d218d310..e64d3985 100644 --- a/javascript/sources/index.wasm.js +++ b/javascript/sources/index.wasm.js @@ -4,18 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow * @format */ -const wrapLib = require('./entry'); +const wrapAsm = require('./wrapAsm'); const loadYoga = require('./wasm-async'); module.exports = { -load: () => { - return loadYoga().then(wrapLib); + load: () => loadYoga().then(wrapAsm), + ...require('./YGEnums'), } -} - -export type * from './YGEnums.js'; -export type * from './entry'; diff --git a/javascript/sources/sync.asmjs.js b/javascript/sources/sync.asmjs.js index b967e046..2e769414 100644 --- a/javascript/sources/sync.asmjs.js +++ b/javascript/sources/sync.asmjs.js @@ -4,14 +4,10 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow * @format */ -const wrapLib = require('./entry'); +const wrapAsm = require('./wrapAsm'); const loadYoga = require('./asmjs-sync'); -module.exports = wrapLib(loadYoga()); - -export type * from './YGEnums.js'; -export type * from './entry'; +module.exports = wrapAsm(loadYoga()); diff --git a/javascript/sources/sync.d.ts b/javascript/sources/sync.d.ts new file mode 100644 index 00000000..350f9492 --- /dev/null +++ b/javascript/sources/sync.d.ts @@ -0,0 +1,16 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + import type {Yoga} from './wrapAsm'; + + export * from './YGEnums'; + export * from './wrapAsm'; + + declare const yoga: Yoga; + export default yoga; diff --git a/javascript/sources/sync.wasm.js b/javascript/sources/sync.wasm.js index 196d7a08..393c6d31 100644 --- a/javascript/sources/sync.wasm.js +++ b/javascript/sources/sync.wasm.js @@ -4,14 +4,10 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow * @format */ -const wrapLib = require('./entry'); +const wrapAsm = require('./wrapAsm'); const loadYoga = require('./wasm-sync'); -module.exports = wrapLib(loadYoga()); - -export type * from './YGEnums.js'; -export type * from './entry'; +module.exports = wrapAsm(loadYoga()); diff --git a/javascript/sources/wrapAsm.d.ts b/javascript/sources/wrapAsm.d.ts new file mode 100644 index 00000000..0e67d5b4 --- /dev/null +++ b/javascript/sources/wrapAsm.d.ts @@ -0,0 +1,168 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + + import type { + Edge, + Wrap, + Align, + FlexDirection, + Gutter, + Direction, + PositionType, + Overflow, + Justify, + Display, + ExperimentalFeature, +} from './YGEnums'; + +import type * as YGEnums from './YGEnums'; + +type Layout = { + left: number; + right: number; + top: number; + bottom: number; + width: number; + height: number; +} + +type Size = { + width: number; + height: number; +} + +type Value = { + unit: number; + value: number; +} + +export type Config = { + isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean, + setExperimentalFeatureEnabled( + feature: ExperimentalFeature, + enabled: boolean, + ): void, + setPointScaleFactor(factor: number): void, +}; + +export type MeasureFunction = ( + width: number, + widthMode: number, + height: number, + heightMode: number) => Size; + +export type Node = { + calculateLayout( + width?: number, + height?: number, + direction?: Direction, + ): void, + copyStyle(node: Node): void, + free(): void, + freeRecursive(): void, + getAlignContent(): Align, + getAlignItems(): Align, + getAlignSelf(): Align, + getAspectRatio(): number, + getBorder(edge: Edge): number, + getChild(index: number): Node, + getChildCount(): number, + getComputedBorder(edge: Edge): number, + getComputedBottom(): number, + getComputedHeight(): number, + getComputedLayout(): Layout, + getComputedLeft(): number, + getComputedMargin(edge: Edge): number, + getComputedPadding(edge: Edge): number, + getComputedRight(): number, + getComputedTop(): number, + getComputedWidth(): number, + getDisplay(): Display, + getFlexBasis(): number, + getFlexDirection(): FlexDirection, + getFlexGrow(): number, + getFlexShrink(): number, + getFlexWrap(): Wrap, + getHeight(): Value, + getJustifyContent(): Justify, + getGap(gutter: Gutter): Value, + getMargin(edge: Edge): Value, + getMaxHeight(): Value, + getMaxWidth(): Value, + getMinHeight(): Value, + getMinWidth(): Value, + getOverflow(): Overflow, + getPadding(edge: Edge): Value, + getParent(): Node | null, + getPosition(edge: Edge): Value, + getPositionType(): PositionType, + getWidth(): Value, + insertChild(child: Node, index: number): void, + isDirty(): boolean, + markDirty(): void, + removeChild(child: Node): void, + reset(): void, + setAlignContent(alignContent: Align): void, + setAlignItems(alignItems: Align): void, + setAlignSelf(alignSelf: Align): void, + setAspectRatio(aspectRatio: number): void, + setBorder(edge: Edge, borderWidth: number): void, + setDisplay(display: Display): void, + setFlex(flex: number): void, + setFlexBasis(flexBasis: number | string): void, + setFlexBasisPercent(flexBasis: number): void, + setFlexBasisAuto(): void, + setFlexDirection(flexDirection: FlexDirection): void, + setFlexGrow(flexGrow: number): void, + setFlexShrink(flexShrink: number): void, + setFlexWrap(flexWrap: Wrap): void, + setHeight(height: number | string): void, + setHeightAuto(): void, + setHeightPercent(height: number): void, + setJustifyContent(justifyContent: Justify): void, + setGap(gutter: Gutter, gapLength: number): Value, + setMargin(edge: Edge, margin: number): void, + setMarginAuto(edge: Edge): void, + setMarginPercent(edge: Edge, margin: number): void, + setMaxHeight(maxHeight: number | string): void, + setMaxHeightPercent(maxHeight: number): void, + setMaxWidth(maxWidth: number | string): void, + setMaxWidthPercent(maxWidth: number): void, + setMeasureFunc(measureFunc: MeasureFunction | null): void, + setMinHeight(minHeight: number | string): void, + setMinHeightPercent(minHeight: number): void, + setMinWidth(minWidth: number | string): void, + setMinWidthPercent(minWidth: number): void, + setOverflow(overflow: Overflow): void, + setPadding(edge: Edge, padding: number | string): void, + setPaddingPercent(edge: Edge, padding: number): void, + setPosition(edge: Edge, position: number | string): void, + setPositionPercent(edge: Edge, position: number): void, + setPositionType(positionType: PositionType): void, + setWidth(width: number | string): void, + setWidthAuto(): void, + setWidthPercent(width: number): void, + unsetMeasureFun(): void, +}; + +export type Yoga = { + Config: { + create(): Config, + destroy(config: Config): any, + }, + Node: { + create(): Node, + createDefault(): Node, + createWithConfig(config: Config): Node, + destroy(node: Node): any, + }, +} & typeof YGEnums; + +declare const wrapAsm: () => Yoga; +export default wrapAsm; diff --git a/javascript/sources/wrapAsm.js b/javascript/sources/wrapAsm.js new file mode 100644 index 00000000..263578b9 --- /dev/null +++ b/javascript/sources/wrapAsm.js @@ -0,0 +1,145 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const CONSTANTS = require('./YGEnums'); + +module.exports = (lib) => { + function patch(prototype, name, fn) { + let original = prototype[name]; + + prototype[name] = function(...args) { + return fn.call(this, original, ...args); + }; + } + + for (let fnName of [ + 'setPosition', + 'setMargin', + 'setFlexBasis', + 'setWidth', + 'setHeight', + 'setMinWidth', + 'setMinHeight', + 'setMaxWidth', + 'setMaxHeight', + 'setPadding', + ]) { + let methods = { + [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName], + [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`], + [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`], + }; + + patch(lib.Node.prototype, fnName, function(original, ...args) { + // We patch all these functions to add support for the following calls: + // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto") + + let value = args.pop(); + let unit, asNumber; + + if (value === 'auto') { + unit = CONSTANTS.UNIT_AUTO; + asNumber = undefined; + } else if (typeof value === 'object') { + unit = value.unit; + asNumber = value.valueOf(); + } else { + unit = + typeof value === 'string' && value.endsWith('%') + ? CONSTANTS.UNIT_PERCENT + : CONSTANTS.UNIT_POINT; + asNumber = parseFloat(value); + if (!Number.isNaN(value) && Number.isNaN(asNumber)) { + throw new Error(`Invalid value ${value} for ${fnName}`); + } + } + + if (!methods[unit]) + throw new Error( + `Failed to execute "${fnName}": Unsupported unit '${value}'`, + ); + + if (asNumber !== undefined) { + return methods[unit].call(this, ...args, asNumber); + } else { + return methods[unit].call(this, ...args); + } + }); + } + + function wrapMeasureFunction(measureFunction) { + return lib.MeasureCallback.implement({ measure: measureFunction }) + } + + patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) { + original.call(this, wrapMeasureFunction(measureFunc)) + }) + + function wrapDirtiedFunc(dirtiedFunction) { + return lib.DirtiedCallback.implement({ dirtied: dirtiedFunction }) + } + + patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) { + original.call(this, wrapDirtiedFunc(dirtiedFunc)) + }) + + patch(lib.Config.prototype, 'free', function() { + // Since we handle the memory allocation ourselves (via lib.Config.create), + // we also need to handle the deallocation + lib.Config.destroy(this); + }); + + patch(lib.Node, 'create', function(_, config) { + // We decide the constructor we want to call depending on the parameters + return config + ? lib.Node.createWithConfig(config) + : lib.Node.createDefault(); + }); + + patch(lib.Node.prototype, 'free', function() { + // Since we handle the memory allocation ourselves (via lib.Node.create), + // we also need to handle the deallocation + lib.Node.destroy(this); + }); + + patch(lib.Node.prototype, 'freeRecursive', function() { + for (let t = 0, T = this.getChildCount(); t < T; ++t) { + this.getChild(0).freeRecursive(); + } + this.free(); + }); + + patch(lib.Node.prototype, 'setMeasureFunc', function(original, measureFunc) { + // This patch is just a convenience patch, since it helps write more + // idiomatic source code (such as .setMeasureFunc(null)) + if (measureFunc) { + return original.call(this, (...args) => + measureFunc(...args), + ); + } else { + return this.unsetMeasureFunc(); + } + }); + + patch(lib.Node.prototype, 'calculateLayout', function( + original, + width = NaN, + height = NaN, + direction = CONSTANTS.DIRECTION_LTR, + ) { + // Just a small patch to add support for the function default parameters + return original.call(this, width, height, direction); + }); + + return { + Config: lib.Config, + Node: lib.Node, + ...CONSTANTS, + }; +}; diff --git a/javascript/yarn.lock b/javascript/yarn.lock index e994255b..9f02eac8 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -472,13 +472,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.18.6.tgz#774d825256f2379d06139be0c723c4dd444f3ca1" - integrity sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-import-assertions@^7.20.0": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" @@ -653,14 +646,6 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-flow-strip-types@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.19.0.tgz#e9e8606633287488216028719638cbbb2f2dde8f" - integrity sha512-sgeMlNaQVbCSpgLSKP4ZZKfsJVnFnNQlUSk6gPYzR/q7tzCgQF2t8RBKAP6cKJeZdveei7Q7Jm527xepI8lNLg== - dependencies: - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/plugin-syntax-flow" "^7.18.6" - "@babel/plugin-transform-for-of@^7.18.8": version "7.18.8" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" @@ -1515,7 +1500,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -1552,7 +1537,7 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -chokidar@^3.0.0, chokidar@^3.4.0: +chokidar@^3.4.0: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -1577,15 +1562,6 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -1672,11 +1648,6 @@ debug@^4.1.0, debug@^4.1.1: dependencies: ms "2.1.2" -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== - dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -1802,26 +1773,6 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -flow-copy-source@^2.0.7: - version "2.0.9" - resolved "https://registry.yarnpkg.com/flow-copy-source/-/flow-copy-source-2.0.9.tgz#0c94ad842f2ae544d5a6b8ae720cee0b8678d742" - integrity sha512-7zX/oHSIHe8YRGiA9QIcC4SW6KF667ikdmiDfbST15up1Ona8dn7Xy0PmSrfw6ceBWDww8sRKlCLKsztStpYkQ== - dependencies: - chokidar "^3.0.0" - fs-extra "^8.1.0" - glob "^7.0.0" - kefir "^3.7.3" - yargs "^15.0.1" - -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -1847,7 +1798,7 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.1, get-caller-file@^2.0.5: +get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -1869,7 +1820,7 @@ glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: +glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -1886,7 +1837,7 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: +graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -2436,18 +2387,6 @@ json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - -kefir@^3.7.3: - version "3.8.8" - resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.8.tgz#235932ddfbed422acebf5d7cba503035e9ea05c5" - integrity sha512-xWga7QCZsR2Wjy2vNL3Kq/irT+IwxwItEWycRRlT5yhqHZK2fmEhziP+LzcJBWSTAMranGKtGTQ6lFpyJS3+jA== - kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -2747,11 +2686,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -2795,11 +2729,6 @@ semver@^7.3.5: dependencies: lru-cache "^6.0.0" -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2981,11 +2910,6 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - update-browserslist-db@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" @@ -3010,11 +2934,6 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -3022,15 +2941,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -3053,11 +2963,6 @@ write-file-atomic@^4.0.1: imurmurhash "^0.1.4" signal-exit "^3.0.7" -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -3073,36 +2978,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs@^15.0.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - yargs@^17.3.1: version "17.6.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" -- 2.50.1.windows.1 From 51a2a3856e54265d8086d627aebc63dee89e89b7 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 03:08:21 -0800 Subject: [PATCH 22/47] Add simple readme and rename APIs --- javascript/README.md | 25 +++++++++++++++++++++++++ javascript/jest.setup.js | 4 ++-- javascript/sources/index.asmjs.js | 4 ++-- javascript/sources/index.d.ts | 2 +- javascript/sources/index.wasm.js | 4 ++-- javascript/sources/sync.asmjs.js | 4 ++-- javascript/sources/sync.wasm.js | 4 ++-- 7 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 javascript/README.md diff --git a/javascript/README.md b/javascript/README.md new file mode 100644 index 00000000..5f6fad3a --- /dev/null +++ b/javascript/README.md @@ -0,0 +1,25 @@ +# yoga-layout + +This package provides JavaScript bindings for the Yoga layout engine as either WebAssembly (for browsers, Node) or asm.js (other clients or clients unable to read package export maps). + +## Usage + +The default entrypoint provides an asynchronous loader function to return a Yoga instance. + +```ts +import { loadYoga, ALIGN_CENTER } from "yoga-layout"; + +const Yoga = await loadYoga(); + +const node = Yoga.Node.create(); +node.setAlignContent(ALIGN_CENTER); +``` + +An alternative synchronous API is provided for compatibility, but requires using asm.js in browsers instead of WebAssembly, leading to worse performance and larger assets. + +```ts +import Yoga, { ALIGN_CENTER } from "yoga-layout/sync"; + +const node = Yoga.Node.create(); +node.setAlignContent(ALIGN_CENTER); +``` diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index 85c6582d..4589c3be 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -13,8 +13,8 @@ module.exports = async () => { } else if (process.env['SYNC']) { global.Yoga = require("./dist/sync.asmjs"); } else if (process.env['WASM']) { - global.Yoga = await require("./dist/index.wasm").load(); + global.Yoga = await require("./dist/index.wasm").loadYoga(); } else { - global.Yoga = await require("./dist/index.asmjs").load(); + global.Yoga = await require("./dist/index.asmjs").loadYoga(); } } diff --git a/javascript/sources/index.asmjs.js b/javascript/sources/index.asmjs.js index ca89851c..6831b01e 100644 --- a/javascript/sources/index.asmjs.js +++ b/javascript/sources/index.asmjs.js @@ -8,9 +8,9 @@ */ const wrapAsm = require('./wrapAsm'); -const loadYoga = require('./asmjs-async'); +const loadAsm = require('./asmjs-async'); module.exports = { - load: () => loadYoga().then(wrapAsm), + loadYoga: () => loadAsm().then(wrapAsm), ...require('./YGEnums'), } diff --git a/javascript/sources/index.d.ts b/javascript/sources/index.d.ts index 7340238a..64bdf899 100644 --- a/javascript/sources/index.d.ts +++ b/javascript/sources/index.d.ts @@ -12,4 +12,4 @@ import type {Yoga} from './wrapAsm'; export * from './YGEnums'; export * from './wrapAsm'; -export function load(): Promise; +export function loadYoga(): Promise; diff --git a/javascript/sources/index.wasm.js b/javascript/sources/index.wasm.js index e64d3985..f9696b2d 100644 --- a/javascript/sources/index.wasm.js +++ b/javascript/sources/index.wasm.js @@ -8,9 +8,9 @@ */ const wrapAsm = require('./wrapAsm'); -const loadYoga = require('./wasm-async'); +const loadAsm = require('./wasm-async'); module.exports = { - load: () => loadYoga().then(wrapAsm), + loadYoga: () => loadAsm().then(wrapAsm), ...require('./YGEnums'), } diff --git a/javascript/sources/sync.asmjs.js b/javascript/sources/sync.asmjs.js index 2e769414..bfb929fc 100644 --- a/javascript/sources/sync.asmjs.js +++ b/javascript/sources/sync.asmjs.js @@ -8,6 +8,6 @@ */ const wrapAsm = require('./wrapAsm'); -const loadYoga = require('./asmjs-sync'); +const loadAsm = require('./asmjs-sync'); -module.exports = wrapAsm(loadYoga()); +module.exports = wrapAsm(loadAsm()); diff --git a/javascript/sources/sync.wasm.js b/javascript/sources/sync.wasm.js index 393c6d31..87280bc3 100644 --- a/javascript/sources/sync.wasm.js +++ b/javascript/sources/sync.wasm.js @@ -8,6 +8,6 @@ */ const wrapAsm = require('./wrapAsm'); -const loadYoga = require('./wasm-sync'); +const loadAsm = require('./wasm-sync'); -module.exports = wrapAsm(loadYoga()); +module.exports = wrapAsm(loadAsm()); -- 2.50.1.windows.1 From 676fa1fbf3d27f0dfd6b3b7dfb06da8eb9bcca0f Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 05:20:51 -0800 Subject: [PATCH 23/47] Format the python matching internal linter --- .github/actions/black/action.yml | 25 +++++++++++++++++++++++++ .github/workflows/validate-python.yml | 21 +++++++++++++++++++++ enums.py | 3 ++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/actions/black/action.yml create mode 100644 .github/workflows/validate-python.yml diff --git a/.github/actions/black/action.yml b/.github/actions/black/action.yml new file mode 100644 index 00000000..63b6c423 --- /dev/null +++ b/.github/actions/black/action.yml @@ -0,0 +1,25 @@ +name: Black Formatter +inputs: + directory: + description: Directory to Lint + required: true + version: + description: pypi version of "black" to use + required: false + default: 22.3.0 + +runs: + using: "composite" + steps: + - name: Ensure supported Python selected + uses: actions/setup-python@v4 + with: + python-version: '>=3.6.2' + + - name: pip install + shell: bash + run: pip install black==${{ inputs.version }} + + - name: black + shell: bash + run: black --check ${{ inputs.directory }} diff --git a/.github/workflows/validate-python.yml b/.github/workflows/validate-python.yml new file mode 100644 index 00000000..6ff392d2 --- /dev/null +++ b/.github/workflows/validate-python.yml @@ -0,0 +1,21 @@ +name: Python + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + format: + name: Format + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: black --check + uses: ./.github/actions/black + with: + directory: ${{ github.workspace }} diff --git a/enums.py b/enums.py index 4cd2a64d..fb77e5b8 100644 --- a/enums.py +++ b/enums.py @@ -260,7 +260,8 @@ with open(root + "/javascript/sources/YGEnums.d.ts", "w") as f: base = value[1] + 1 else: f.write( - "export const %s_%s: %d;\n" % (to_java_upper(name), to_java_upper(value), base) + "export const %s_%s: %d;\n" + % (to_java_upper(name), to_java_upper(value), base) ) base += 1 -- 2.50.1.windows.1 From a894e50ca458e070c780463654460e6391dd25c8 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 05:36:58 -0800 Subject: [PATCH 24/47] Try explicitly installing ninja --- .github/actions/setup-js/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml index fce20c96..37a23813 100644 --- a/.github/actions/setup-js/action.yml +++ b/.github/actions/setup-js/action.yml @@ -11,6 +11,9 @@ runs: - name: Install emsdk uses: ./.github/actions/install-emsdk + - name: Install ninja + uses: sudo apt-get install -y ninja-build + - name: yarn install shell: bash run: yarn install --frozen-lockfile -- 2.50.1.windows.1 From 27590f1adce2c73fc344b89e53db563dc12e587a Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 05:38:11 -0800 Subject: [PATCH 25/47] . --- .github/actions/setup-js/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml index 37a23813..17ce83ed 100644 --- a/.github/actions/setup-js/action.yml +++ b/.github/actions/setup-js/action.yml @@ -12,7 +12,8 @@ runs: uses: ./.github/actions/install-emsdk - name: Install ninja - uses: sudo apt-get install -y ninja-build + shell: bash + run: sudo apt-get install -y ninja-build - name: yarn install shell: bash -- 2.50.1.windows.1 From b09aad433be89cb2127b3121864267a65877ee39 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 06:38:56 -0800 Subject: [PATCH 26/47] benchmark in Actions, opaque/safe enum types, more explicit test scripts --- .github/workflows/validate-js.yml | 4 + enums.py | 44 ++--- javascript/jest.setup.js | 6 +- javascript/package.json | 6 +- javascript/sources/YGEnums.d.ts | 260 ++++++++++++++++++++++-------- 5 files changed, 227 insertions(+), 93 deletions(-) diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml index da62cf4d..84587a0f 100644 --- a/.github/workflows/validate-js.yml +++ b/.github/workflows/validate-js.yml @@ -25,3 +25,7 @@ jobs: - name: yarn test run: yarn test working-directory: javascript + + - name: yarn benchmark + run: yarn benchmark + working-directory: javascript diff --git a/enums.py b/enums.py index fb77e5b8..d8e7758e 100644 --- a/enums.py +++ b/enums.py @@ -230,17 +230,14 @@ with open(root + "/javascript/sources/YGEnums.js", "w") as f: f.write(" %s_COUNT: %s,\n" % (to_java_upper(name), len(values))) base = 0 for value in values: - if isinstance(value, tuple): - f.write( - " %s_%s: %d,\n" - % (to_java_upper(name), to_java_upper(value[0]), value[1]) - ) - base = value[1] + 1 - else: - f.write( - " %s_%s: %d,\n" % (to_java_upper(name), to_java_upper(value), base) - ) - base += 1 + value_arg = value[0] if isinstance(value, tuple) else value + ordinal_arg = value[1] if isinstance(value, tuple) else base + + f.write( + " %s_%s: %d,\n" + % (to_java_upper(name), to_java_upper(value_arg), ordinal_arg) + ) + base = ordinal_arg + 1 if name != items[-1][0]: f.write("\n") @@ -252,18 +249,21 @@ with open(root + "/javascript/sources/YGEnums.d.ts", "w") as f: for name, values in sorted(ENUMS.items()): base = 0 for value in values: - if isinstance(value, tuple): - f.write( - "export const %s_%s: %d;\n" - % (to_java_upper(name), to_java_upper(value[0]), value[1]) + value_arg = value[0] if isinstance(value, tuple) else value + ordinal_arg = value[1] if isinstance(value, tuple) else base + + f.write( + ( + "type {name}_{value} = {ordinal} & ['{name}']\n" + + "export const {name}_{value}: {name}_{value};\n\n" + ).format( + name=to_java_upper(name), + value=to_java_upper(value_arg), + ordinal=ordinal_arg, ) - base = value[1] + 1 - else: - f.write( - "export const %s_%s: %d;\n" - % (to_java_upper(name), to_java_upper(value), base) - ) - base += 1 + ) + + base = ordinal_arg + 1 f.write("\n") diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index 4589c3be..3a64ee47 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -8,11 +8,11 @@ */ module.exports = async () => { - if (process.env['SYNC'] && process.env['WASM']) { + if (process.env['SYNC'] == true && process.env['WASM'] == true) { global.Yoga = require("./dist/sync.wasm"); - } else if (process.env['SYNC']) { + } else if (process.env['SYNC'] == true) { global.Yoga = require("./dist/sync.asmjs"); - } else if (process.env['WASM']) { + } else if (process.env['WASM'] == true) { global.Yoga = await require("./dist/index.wasm").loadYoga(); } else { global.Yoga = await require("./dist/index.asmjs").loadYoga(); diff --git a/javascript/package.json b/javascript/package.json index db90ae73..12e46de0 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -31,9 +31,9 @@ "build:native-project": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", "build:js": "babel sources --source-maps --out-dir dist && cp -r sources/*.d.ts dist", "test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync", - "test:asmjs": "jest", - "test:asmjs-sync": "SYNC=1 jest", - "test:wasm": "WASM=1 jest", + "test:asmjs": "WASM=0 SYNC=0 jest", + "test:asmjs-sync": "WASM=0 SYNC=1 jest", + "test:wasm": "WASM=1 SYNC=0 jest", "test:wasm-sync": "WASM=1 SYNC=1 jest", "benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')" }, diff --git a/javascript/sources/YGEnums.d.ts b/javascript/sources/YGEnums.d.ts index 1230c1c7..26272de5 100644 --- a/javascript/sources/YGEnums.d.ts +++ b/javascript/sources/YGEnums.d.ts @@ -7,87 +7,217 @@ // @generated by enums.py -export const ALIGN_AUTO: 0; -export const ALIGN_FLEX_START: 1; -export const ALIGN_CENTER: 2; -export const ALIGN_FLEX_END: 3; -export const ALIGN_STRETCH: 4; -export const ALIGN_BASELINE: 5; -export const ALIGN_SPACE_BETWEEN: 6; -export const ALIGN_SPACE_AROUND: 7; +type ALIGN_AUTO = 0 & ['ALIGN'] +export const ALIGN_AUTO: ALIGN_AUTO; -export const DIMENSION_WIDTH: 0; -export const DIMENSION_HEIGHT: 1; +type ALIGN_FLEX_START = 1 & ['ALIGN'] +export const ALIGN_FLEX_START: ALIGN_FLEX_START; -export const DIRECTION_INHERIT: 0; -export const DIRECTION_LTR: 1; -export const DIRECTION_RTL: 2; +type ALIGN_CENTER = 2 & ['ALIGN'] +export const ALIGN_CENTER: ALIGN_CENTER; -export const DISPLAY_FLEX: 0; -export const DISPLAY_NONE: 1; +type ALIGN_FLEX_END = 3 & ['ALIGN'] +export const ALIGN_FLEX_END: ALIGN_FLEX_END; -export const EDGE_LEFT: 0; -export const EDGE_TOP: 1; -export const EDGE_RIGHT: 2; -export const EDGE_BOTTOM: 3; -export const EDGE_START: 4; -export const EDGE_END: 5; -export const EDGE_HORIZONTAL: 6; -export const EDGE_VERTICAL: 7; -export const EDGE_ALL: 8; +type ALIGN_STRETCH = 4 & ['ALIGN'] +export const ALIGN_STRETCH: ALIGN_STRETCH; -export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0; +type ALIGN_BASELINE = 5 & ['ALIGN'] +export const ALIGN_BASELINE: ALIGN_BASELINE; -export const FLEX_DIRECTION_COLUMN: 0; -export const FLEX_DIRECTION_COLUMN_REVERSE: 1; -export const FLEX_DIRECTION_ROW: 2; -export const FLEX_DIRECTION_ROW_REVERSE: 3; +type ALIGN_SPACE_BETWEEN = 6 & ['ALIGN'] +export const ALIGN_SPACE_BETWEEN: ALIGN_SPACE_BETWEEN; -export const GUTTER_COLUMN: 0; -export const GUTTER_ROW: 1; -export const GUTTER_ALL: 2; +type ALIGN_SPACE_AROUND = 7 & ['ALIGN'] +export const ALIGN_SPACE_AROUND: ALIGN_SPACE_AROUND; -export const JUSTIFY_FLEX_START: 0; -export const JUSTIFY_CENTER: 1; -export const JUSTIFY_FLEX_END: 2; -export const JUSTIFY_SPACE_BETWEEN: 3; -export const JUSTIFY_SPACE_AROUND: 4; -export const JUSTIFY_SPACE_EVENLY: 5; -export const LOG_LEVEL_ERROR: 0; -export const LOG_LEVEL_WARN: 1; -export const LOG_LEVEL_INFO: 2; -export const LOG_LEVEL_DEBUG: 3; -export const LOG_LEVEL_VERBOSE: 4; -export const LOG_LEVEL_FATAL: 5; +type DIMENSION_WIDTH = 0 & ['DIMENSION'] +export const DIMENSION_WIDTH: DIMENSION_WIDTH; -export const MEASURE_MODE_UNDEFINED: 0; -export const MEASURE_MODE_EXACTLY: 1; -export const MEASURE_MODE_AT_MOST: 2; +type DIMENSION_HEIGHT = 1 & ['DIMENSION'] +export const DIMENSION_HEIGHT: DIMENSION_HEIGHT; -export const NODE_TYPE_DEFAULT: 0; -export const NODE_TYPE_TEXT: 1; -export const OVERFLOW_VISIBLE: 0; -export const OVERFLOW_HIDDEN: 1; -export const OVERFLOW_SCROLL: 2; +type DIRECTION_INHERIT = 0 & ['DIRECTION'] +export const DIRECTION_INHERIT: DIRECTION_INHERIT; -export const POSITION_TYPE_STATIC: 0; -export const POSITION_TYPE_RELATIVE: 1; -export const POSITION_TYPE_ABSOLUTE: 2; +type DIRECTION_LTR = 1 & ['DIRECTION'] +export const DIRECTION_LTR: DIRECTION_LTR; -export const PRINT_OPTIONS_LAYOUT: 1; -export const PRINT_OPTIONS_STYLE: 2; -export const PRINT_OPTIONS_CHILDREN: 4; +type DIRECTION_RTL = 2 & ['DIRECTION'] +export const DIRECTION_RTL: DIRECTION_RTL; -export const UNIT_UNDEFINED: 0; -export const UNIT_POINT: 1; -export const UNIT_PERCENT: 2; -export const UNIT_AUTO: 3; -export const WRAP_NO_WRAP: 0; -export const WRAP_WRAP: 1; -export const WRAP_WRAP_REVERSE: 2; +type DISPLAY_FLEX = 0 & ['DISPLAY'] +export const DISPLAY_FLEX: DISPLAY_FLEX; + +type DISPLAY_NONE = 1 & ['DISPLAY'] +export const DISPLAY_NONE: DISPLAY_NONE; + + +type EDGE_LEFT = 0 & ['EDGE'] +export const EDGE_LEFT: EDGE_LEFT; + +type EDGE_TOP = 1 & ['EDGE'] +export const EDGE_TOP: EDGE_TOP; + +type EDGE_RIGHT = 2 & ['EDGE'] +export const EDGE_RIGHT: EDGE_RIGHT; + +type EDGE_BOTTOM = 3 & ['EDGE'] +export const EDGE_BOTTOM: EDGE_BOTTOM; + +type EDGE_START = 4 & ['EDGE'] +export const EDGE_START: EDGE_START; + +type EDGE_END = 5 & ['EDGE'] +export const EDGE_END: EDGE_END; + +type EDGE_HORIZONTAL = 6 & ['EDGE'] +export const EDGE_HORIZONTAL: EDGE_HORIZONTAL; + +type EDGE_VERTICAL = 7 & ['EDGE'] +export const EDGE_VERTICAL: EDGE_VERTICAL; + +type EDGE_ALL = 8 & ['EDGE'] +export const EDGE_ALL: EDGE_ALL; + + +type EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 & ['EXPERIMENTAL_FEATURE'] +export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS; + + +type FLEX_DIRECTION_COLUMN = 0 & ['FLEX_DIRECTION'] +export const FLEX_DIRECTION_COLUMN: FLEX_DIRECTION_COLUMN; + +type FLEX_DIRECTION_COLUMN_REVERSE = 1 & ['FLEX_DIRECTION'] +export const FLEX_DIRECTION_COLUMN_REVERSE: FLEX_DIRECTION_COLUMN_REVERSE; + +type FLEX_DIRECTION_ROW = 2 & ['FLEX_DIRECTION'] +export const FLEX_DIRECTION_ROW: FLEX_DIRECTION_ROW; + +type FLEX_DIRECTION_ROW_REVERSE = 3 & ['FLEX_DIRECTION'] +export const FLEX_DIRECTION_ROW_REVERSE: FLEX_DIRECTION_ROW_REVERSE; + + +type GUTTER_COLUMN = 0 & ['GUTTER'] +export const GUTTER_COLUMN: GUTTER_COLUMN; + +type GUTTER_ROW = 1 & ['GUTTER'] +export const GUTTER_ROW: GUTTER_ROW; + +type GUTTER_ALL = 2 & ['GUTTER'] +export const GUTTER_ALL: GUTTER_ALL; + + +type JUSTIFY_FLEX_START = 0 & ['JUSTIFY'] +export const JUSTIFY_FLEX_START: JUSTIFY_FLEX_START; + +type JUSTIFY_CENTER = 1 & ['JUSTIFY'] +export const JUSTIFY_CENTER: JUSTIFY_CENTER; + +type JUSTIFY_FLEX_END = 2 & ['JUSTIFY'] +export const JUSTIFY_FLEX_END: JUSTIFY_FLEX_END; + +type JUSTIFY_SPACE_BETWEEN = 3 & ['JUSTIFY'] +export const JUSTIFY_SPACE_BETWEEN: JUSTIFY_SPACE_BETWEEN; + +type JUSTIFY_SPACE_AROUND = 4 & ['JUSTIFY'] +export const JUSTIFY_SPACE_AROUND: JUSTIFY_SPACE_AROUND; + +type JUSTIFY_SPACE_EVENLY = 5 & ['JUSTIFY'] +export const JUSTIFY_SPACE_EVENLY: JUSTIFY_SPACE_EVENLY; + + +type LOG_LEVEL_ERROR = 0 & ['LOG_LEVEL'] +export const LOG_LEVEL_ERROR: LOG_LEVEL_ERROR; + +type LOG_LEVEL_WARN = 1 & ['LOG_LEVEL'] +export const LOG_LEVEL_WARN: LOG_LEVEL_WARN; + +type LOG_LEVEL_INFO = 2 & ['LOG_LEVEL'] +export const LOG_LEVEL_INFO: LOG_LEVEL_INFO; + +type LOG_LEVEL_DEBUG = 3 & ['LOG_LEVEL'] +export const LOG_LEVEL_DEBUG: LOG_LEVEL_DEBUG; + +type LOG_LEVEL_VERBOSE = 4 & ['LOG_LEVEL'] +export const LOG_LEVEL_VERBOSE: LOG_LEVEL_VERBOSE; + +type LOG_LEVEL_FATAL = 5 & ['LOG_LEVEL'] +export const LOG_LEVEL_FATAL: LOG_LEVEL_FATAL; + + +type MEASURE_MODE_UNDEFINED = 0 & ['MEASURE_MODE'] +export const MEASURE_MODE_UNDEFINED: MEASURE_MODE_UNDEFINED; + +type MEASURE_MODE_EXACTLY = 1 & ['MEASURE_MODE'] +export const MEASURE_MODE_EXACTLY: MEASURE_MODE_EXACTLY; + +type MEASURE_MODE_AT_MOST = 2 & ['MEASURE_MODE'] +export const MEASURE_MODE_AT_MOST: MEASURE_MODE_AT_MOST; + + +type NODE_TYPE_DEFAULT = 0 & ['NODE_TYPE'] +export const NODE_TYPE_DEFAULT: NODE_TYPE_DEFAULT; + +type NODE_TYPE_TEXT = 1 & ['NODE_TYPE'] +export const NODE_TYPE_TEXT: NODE_TYPE_TEXT; + + +type OVERFLOW_VISIBLE = 0 & ['OVERFLOW'] +export const OVERFLOW_VISIBLE: OVERFLOW_VISIBLE; + +type OVERFLOW_HIDDEN = 1 & ['OVERFLOW'] +export const OVERFLOW_HIDDEN: OVERFLOW_HIDDEN; + +type OVERFLOW_SCROLL = 2 & ['OVERFLOW'] +export const OVERFLOW_SCROLL: OVERFLOW_SCROLL; + + +type POSITION_TYPE_STATIC = 0 & ['POSITION_TYPE'] +export const POSITION_TYPE_STATIC: POSITION_TYPE_STATIC; + +type POSITION_TYPE_RELATIVE = 1 & ['POSITION_TYPE'] +export const POSITION_TYPE_RELATIVE: POSITION_TYPE_RELATIVE; + +type POSITION_TYPE_ABSOLUTE = 2 & ['POSITION_TYPE'] +export const POSITION_TYPE_ABSOLUTE: POSITION_TYPE_ABSOLUTE; + + +type PRINT_OPTIONS_LAYOUT = 1 & ['PRINT_OPTIONS'] +export const PRINT_OPTIONS_LAYOUT: PRINT_OPTIONS_LAYOUT; + +type PRINT_OPTIONS_STYLE = 2 & ['PRINT_OPTIONS'] +export const PRINT_OPTIONS_STYLE: PRINT_OPTIONS_STYLE; + +type PRINT_OPTIONS_CHILDREN = 4 & ['PRINT_OPTIONS'] +export const PRINT_OPTIONS_CHILDREN: PRINT_OPTIONS_CHILDREN; + + +type UNIT_UNDEFINED = 0 & ['UNIT'] +export const UNIT_UNDEFINED: UNIT_UNDEFINED; + +type UNIT_POINT = 1 & ['UNIT'] +export const UNIT_POINT: UNIT_POINT; + +type UNIT_PERCENT = 2 & ['UNIT'] +export const UNIT_PERCENT: UNIT_PERCENT; + +type UNIT_AUTO = 3 & ['UNIT'] +export const UNIT_AUTO: UNIT_AUTO; + + +type WRAP_NO_WRAP = 0 & ['WRAP'] +export const WRAP_NO_WRAP: WRAP_NO_WRAP; + +type WRAP_WRAP = 1 & ['WRAP'] +export const WRAP_WRAP: WRAP_WRAP; + +type WRAP_WRAP_REVERSE = 2 & ['WRAP'] +export const WRAP_WRAP_REVERSE: WRAP_WRAP_REVERSE; + export type Align = | typeof ALIGN_AUTO -- 2.50.1.windows.1 From 025698132f9a23dbe00cd092578888b534ec0a5e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 07:30:15 -0800 Subject: [PATCH 27/47] Cleanup entrypoints --- enums.py | 4 +-- javascript/CMakeLists.txt | 4 +-- javascript/jest.setup.js | 8 ++--- javascript/package.json | 30 ++++++++++--------- javascript/sources/index.asmjs.js | 16 ---------- .../index.wasm.js => src_js/entryAsync.js} | 7 ++--- .../sync.wasm.js => src_js/entrySync.js} | 6 ++-- .../generated}/YGEnums.d.ts | 0 .../{sources => src_js/generated}/YGEnums.js | 0 javascript/{sources => src_js}/index.d.ts | 2 +- .../sync.asmjs.js => src_js/index.js} | 6 ++-- javascript/src_js/sync.d.ts | 16 ++++++++++ .../{sources/sync.d.ts => src_js/sync.js} | 9 ++---- javascript/src_js/variants/asmjs-async.js | 11 +++++++ javascript/src_js/variants/asmjs-sync.js | 11 +++++++ javascript/src_js/variants/wasm-async.js | 11 +++++++ javascript/src_js/variants/wasm-sync.js | 11 +++++++ javascript/{sources => src_js}/wrapAsm.d.ts | 6 ++-- javascript/{sources => src_js}/wrapAsm.js | 2 +- javascript/{sources => src_native}/Config.cc | 0 javascript/{sources => src_native}/Config.hh | 0 javascript/{sources => src_native}/Layout.hh | 0 javascript/{sources => src_native}/Node.cc | 0 javascript/{sources => src_native}/Node.hh | 0 javascript/{sources => src_native}/Size.hh | 0 javascript/{sources => src_native}/Value.hh | 0 javascript/{sources => src_native}/embind.cc | 0 javascript/tests/run-bench.js | 2 +- 28 files changed, 99 insertions(+), 63 deletions(-) delete mode 100644 javascript/sources/index.asmjs.js rename javascript/{sources/index.wasm.js => src_js/entryAsync.js} (76%) rename javascript/{sources/sync.wasm.js => src_js/entrySync.js} (63%) rename javascript/{sources => src_js/generated}/YGEnums.d.ts (100%) rename javascript/{sources => src_js/generated}/YGEnums.js (100%) rename javascript/{sources => src_js}/index.d.ts (89%) rename javascript/{sources/sync.asmjs.js => src_js/index.js} (63%) create mode 100644 javascript/src_js/sync.d.ts rename javascript/{sources/sync.d.ts => src_js/sync.js} (58%) create mode 100644 javascript/src_js/variants/asmjs-async.js create mode 100644 javascript/src_js/variants/asmjs-sync.js create mode 100644 javascript/src_js/variants/wasm-async.js create mode 100644 javascript/src_js/variants/wasm-sync.js rename javascript/{sources => src_js}/wrapAsm.d.ts (97%) rename javascript/{sources => src_js}/wrapAsm.js (98%) rename javascript/{sources => src_native}/Config.cc (100%) rename javascript/{sources => src_native}/Config.hh (100%) rename javascript/{sources => src_native}/Layout.hh (100%) rename javascript/{sources => src_native}/Node.cc (100%) rename javascript/{sources => src_native}/Node.hh (100%) rename javascript/{sources => src_native}/Size.hh (100%) rename javascript/{sources => src_native}/Value.hh (100%) rename javascript/{sources => src_native}/embind.cc (100%) diff --git a/enums.py b/enums.py index d8e7758e..26b605ca 100644 --- a/enums.py +++ b/enums.py @@ -222,7 +222,7 @@ for name, values in sorted(ENUMS.items()): f.write("}\n") # write out javascript file -with open(root + "/javascript/sources/YGEnums.js", "w") as f: +with open(root + "/javascript/src_js/generated/YGEnums.js", "w") as f: f.write(get_license("js")) f.write("module.exports = {\n") items = sorted(ENUMS.items()) @@ -243,7 +243,7 @@ with open(root + "/javascript/sources/YGEnums.js", "w") as f: f.write("\n") f.write("};\n") -with open(root + "/javascript/sources/YGEnums.d.ts", "w") as f: +with open(root + "/javascript/src_js/generated/YGEnums.d.ts", "w") as f: f.write(get_license("js")) for name, values in sorted(ENUMS.items()): diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index 4cc3f69e..00757fad 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -10,7 +10,7 @@ project(yoga) file(GLOB SOURCES ../yoga/*.cpp ../yoga/**/*.cpp - sources/*.cc) + src_native/*.cc) include_directories(..) @@ -49,7 +49,7 @@ link_libraries(embind) add_library(yogaObjLib OBJECT ${SOURCES}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dist/build) add_executable(asmjs-sync $) target_link_options(asmjs-sync PUBLIC diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index 3a64ee47..e38327c2 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -9,12 +9,12 @@ module.exports = async () => { if (process.env['SYNC'] == true && process.env['WASM'] == true) { - global.Yoga = require("./dist/sync.wasm"); + global.Yoga = require("./dist/variants/wasm-sync"); } else if (process.env['SYNC'] == true) { - global.Yoga = require("./dist/sync.asmjs"); + global.Yoga = require("./dist/variants/asmjs-sync"); } else if (process.env['WASM'] == true) { - global.Yoga = await require("./dist/index.wasm").loadYoga(); + global.Yoga = await require("./dist/variants/wasm-async").loadYoga(); } else { - global.Yoga = await require("./dist/index.asmjs").loadYoga(); + global.Yoga = await require("./dist/variants/asmjs-async").loadYoga(); } } diff --git a/javascript/package.json b/javascript/package.json index 12e46de0..28bf1849 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -7,35 +7,37 @@ "type": "git", "url": "git@github.com:facebook/yoga.git" }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { ".": { - "browser": "./dist/index.wasm.js", - "node": "./dist/index.wasm.js", - "react-native": "./dist/index.asmjs.js", - "default": "./dist/index.asmjs.js" + "browser": "./dist/variants/wasm-async.js", + "node": "./dist/variants/wasm-async.js", + "default": "./dist/variants/asmjs-async.js" }, "./sync": { - "browser": "./dist/sync.asmks.js", - "node": "./dist/sync.wasm.js", - "react-native": "./dist/sync.asmjs.js", - "default": "./dist/sync.asmjs.js" + "browser": "./dist/variants/asmjs-sync.js", + "node": "./dist/variants/wasm-sync.js", + "default": "./dist/variants/asmjs-sync.js" } }, "files": [ "dist/**", - "sources/**" + "src_js/**" ], "scripts": { + "benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')", "build": "yarn build:native && yarn build:js", - "build:native": "yarn build:native-project && cmake --build build", - "build:native-project": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", - "build:js": "babel sources --source-maps --out-dir dist && cp -r sources/*.d.ts dist", + "build:configure": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", + "build:copy-dts": "cd src_js && find . -name '*.d.ts' | cpio -pdm ../dist", + "build:js": "babel src_js --source-maps --out-dir dist && yarn build:copy-dts", + "build:native": "yarn build:configure && cmake --build build", + "postinstall": "yarn build", "test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync", "test:asmjs": "WASM=0 SYNC=0 jest", "test:asmjs-sync": "WASM=0 SYNC=1 jest", "test:wasm": "WASM=1 SYNC=0 jest", - "test:wasm-sync": "WASM=1 SYNC=1 jest", - "benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')" + "test:wasm-sync": "WASM=1 SYNC=1 jest" }, "devDependencies": { "@babel/cli": "^7.20.7", diff --git a/javascript/sources/index.asmjs.js b/javascript/sources/index.asmjs.js deleted file mode 100644 index 6831b01e..00000000 --- a/javascript/sources/index.asmjs.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -const wrapAsm = require('./wrapAsm'); -const loadAsm = require('./asmjs-async'); - -module.exports = { - loadYoga: () => loadAsm().then(wrapAsm), - ...require('./YGEnums'), -} diff --git a/javascript/sources/index.wasm.js b/javascript/src_js/entryAsync.js similarity index 76% rename from javascript/sources/index.wasm.js rename to javascript/src_js/entryAsync.js index f9696b2d..f9957efa 100644 --- a/javascript/sources/index.wasm.js +++ b/javascript/src_js/entryAsync.js @@ -8,9 +8,8 @@ */ const wrapAsm = require('./wrapAsm'); -const loadAsm = require('./wasm-async'); -module.exports = { +module.exports = (loadAsm) => ({ loadYoga: () => loadAsm().then(wrapAsm), - ...require('./YGEnums'), -} + ...require('./generated/YGEnums'), +}); diff --git a/javascript/sources/sync.wasm.js b/javascript/src_js/entrySync.js similarity index 63% rename from javascript/sources/sync.wasm.js rename to javascript/src_js/entrySync.js index 87280bc3..b1cfe71c 100644 --- a/javascript/sources/sync.wasm.js +++ b/javascript/src_js/entrySync.js @@ -7,7 +7,5 @@ * @format */ -const wrapAsm = require('./wrapAsm'); -const loadAsm = require('./wasm-sync'); - -module.exports = wrapAsm(loadAsm()); + const wrapAsm = require('./wrapAsm'); + module.exports = (asm) => wrapAsm(asm()); diff --git a/javascript/sources/YGEnums.d.ts b/javascript/src_js/generated/YGEnums.d.ts similarity index 100% rename from javascript/sources/YGEnums.d.ts rename to javascript/src_js/generated/YGEnums.d.ts diff --git a/javascript/sources/YGEnums.js b/javascript/src_js/generated/YGEnums.js similarity index 100% rename from javascript/sources/YGEnums.js rename to javascript/src_js/generated/YGEnums.js diff --git a/javascript/sources/index.d.ts b/javascript/src_js/index.d.ts similarity index 89% rename from javascript/sources/index.d.ts rename to javascript/src_js/index.d.ts index 64bdf899..fb2830e4 100644 --- a/javascript/sources/index.d.ts +++ b/javascript/src_js/index.d.ts @@ -9,7 +9,7 @@ import type {Yoga} from './wrapAsm'; -export * from './YGEnums'; +export * from './generated/YGEnums'; export * from './wrapAsm'; export function loadYoga(): Promise; diff --git a/javascript/sources/sync.asmjs.js b/javascript/src_js/index.js similarity index 63% rename from javascript/sources/sync.asmjs.js rename to javascript/src_js/index.js index bfb929fc..2864db0c 100644 --- a/javascript/sources/sync.asmjs.js +++ b/javascript/src_js/index.js @@ -7,7 +7,5 @@ * @format */ -const wrapAsm = require('./wrapAsm'); -const loadAsm = require('./asmjs-sync'); - -module.exports = wrapAsm(loadAsm()); +// Fallback for when the export map is not followed +module.exports = require('./variants/asmjs-async'); diff --git a/javascript/src_js/sync.d.ts b/javascript/src_js/sync.d.ts new file mode 100644 index 00000000..27bd8ecc --- /dev/null +++ b/javascript/src_js/sync.d.ts @@ -0,0 +1,16 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import type {Yoga} from './wrapAsm'; + +export * from './generated/YGEnums'; +export * from './wrapAsm'; + +declare const yoga: Yoga; +export default yoga; diff --git a/javascript/sources/sync.d.ts b/javascript/src_js/sync.js similarity index 58% rename from javascript/sources/sync.d.ts rename to javascript/src_js/sync.js index 350f9492..5a79514e 100644 --- a/javascript/sources/sync.d.ts +++ b/javascript/src_js/sync.js @@ -7,10 +7,5 @@ * @format */ - import type {Yoga} from './wrapAsm'; - - export * from './YGEnums'; - export * from './wrapAsm'; - - declare const yoga: Yoga; - export default yoga; +// Fallback for when the export map is not followed +module.exports = require('./variants/asmjs-sync'); diff --git a/javascript/src_js/variants/asmjs-async.js b/javascript/src_js/variants/asmjs-async.js new file mode 100644 index 00000000..02d4097c --- /dev/null +++ b/javascript/src_js/variants/asmjs-async.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const asm = require('../build/asmjs-async'); +module.exports = require("../entryAsync")(asm); diff --git a/javascript/src_js/variants/asmjs-sync.js b/javascript/src_js/variants/asmjs-sync.js new file mode 100644 index 00000000..6bcf004f --- /dev/null +++ b/javascript/src_js/variants/asmjs-sync.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const asm = require('../build/asmjs-sync'); +module.exports = require("../entrySync")(asm); diff --git a/javascript/src_js/variants/wasm-async.js b/javascript/src_js/variants/wasm-async.js new file mode 100644 index 00000000..02906e31 --- /dev/null +++ b/javascript/src_js/variants/wasm-async.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const asm = require('../build/wasm-async'); +module.exports = require("../entryAsync")(asm); diff --git a/javascript/src_js/variants/wasm-sync.js b/javascript/src_js/variants/wasm-sync.js new file mode 100644 index 00000000..f74af006 --- /dev/null +++ b/javascript/src_js/variants/wasm-sync.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const asm = require('../build/wasm-sync'); +module.exports = require("../entrySync")(asm); diff --git a/javascript/sources/wrapAsm.d.ts b/javascript/src_js/wrapAsm.d.ts similarity index 97% rename from javascript/sources/wrapAsm.d.ts rename to javascript/src_js/wrapAsm.d.ts index 0e67d5b4..805ac812 100644 --- a/javascript/sources/wrapAsm.d.ts +++ b/javascript/src_js/wrapAsm.d.ts @@ -7,7 +7,7 @@ * @format */ - import type { +import type { Edge, Wrap, Align, @@ -19,9 +19,9 @@ Justify, Display, ExperimentalFeature, -} from './YGEnums'; +} from './generated/YGEnums'; -import type * as YGEnums from './YGEnums'; +import type * as YGEnums from './generated/YGEnums'; type Layout = { left: number; diff --git a/javascript/sources/wrapAsm.js b/javascript/src_js/wrapAsm.js similarity index 98% rename from javascript/sources/wrapAsm.js rename to javascript/src_js/wrapAsm.js index 263578b9..f6e52e5b 100644 --- a/javascript/sources/wrapAsm.js +++ b/javascript/src_js/wrapAsm.js @@ -7,7 +7,7 @@ * @format */ -const CONSTANTS = require('./YGEnums'); +const CONSTANTS = require('./generated/YGEnums'); module.exports = (lib) => { function patch(prototype, name, fn) { diff --git a/javascript/sources/Config.cc b/javascript/src_native/Config.cc similarity index 100% rename from javascript/sources/Config.cc rename to javascript/src_native/Config.cc diff --git a/javascript/sources/Config.hh b/javascript/src_native/Config.hh similarity index 100% rename from javascript/sources/Config.hh rename to javascript/src_native/Config.hh diff --git a/javascript/sources/Layout.hh b/javascript/src_native/Layout.hh similarity index 100% rename from javascript/sources/Layout.hh rename to javascript/src_native/Layout.hh diff --git a/javascript/sources/Node.cc b/javascript/src_native/Node.cc similarity index 100% rename from javascript/sources/Node.cc rename to javascript/src_native/Node.cc diff --git a/javascript/sources/Node.hh b/javascript/src_native/Node.hh similarity index 100% rename from javascript/sources/Node.hh rename to javascript/src_native/Node.hh diff --git a/javascript/sources/Size.hh b/javascript/src_native/Size.hh similarity index 100% rename from javascript/sources/Size.hh rename to javascript/src_native/Size.hh diff --git a/javascript/sources/Value.hh b/javascript/src_native/Value.hh similarity index 100% rename from javascript/sources/Value.hh rename to javascript/src_native/Value.hh diff --git a/javascript/sources/embind.cc b/javascript/src_native/embind.cc similarity index 100% rename from javascript/sources/embind.cc rename to javascript/src_native/embind.cc diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index 0475b5e0..02ca7dae 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -27,7 +27,7 @@ for (let type of ['asmjs', 'wasm']) { vm.runInNewContext( file, Object.assign(Object.create(global), { - Yoga: require(type === 'asmjs' ? '../dist/sync.asmjs' : '../dist/sync.wasm'), + Yoga: require(type === 'asmjs' ? '../dist/variants/asmjs-sync' : '../dist/variants/wasm-sync'), YGBENCHMARK: function(name, fn) { let testEntry = testResults.get(name); -- 2.50.1.windows.1 From c829abf257ec9be528fdb8e2ddbf06a70335a1a0 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 07:39:26 -0800 Subject: [PATCH 28/47] --ignore-scripts so build is outside of setup in CI --- .github/actions/setup-js/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml index 17ce83ed..93c4fd3c 100644 --- a/.github/actions/setup-js/action.yml +++ b/.github/actions/setup-js/action.yml @@ -17,5 +17,5 @@ runs: - name: yarn install shell: bash - run: yarn install --frozen-lockfile + run: yarn install --frozen-lockfile --ignore-scripts working-directory: javascript -- 2.50.1.windows.1 From 0a82167c308dd342486cef1c4c782253d8aeeb0e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 23 Dec 2022 23:49:35 -0800 Subject: [PATCH 29/47] Refactor entrypoints --- .github/actions/setup-js/action.yml | 2 +- javascript/README.md | 29 ++++++++++++++++++- javascript/jest.setup.js | 8 ++--- javascript/package.json | 17 +++++------ .../_entryAsync.js} | 0 .../_entrySync.js} | 0 .../{variants => entrypoint}/asmjs-async.js | 2 +- .../{variants => entrypoint}/asmjs-sync.js | 2 +- .../{variants => entrypoint}/wasm-async.js | 2 +- .../{variants => entrypoint}/wasm-sync.js | 2 +- javascript/src_js/index.js | 2 +- javascript/src_js/sync.js | 2 +- javascript/tests/run-bench.js | 2 +- 13 files changed, 48 insertions(+), 22 deletions(-) rename javascript/src_js/{entryAsync.js => entrypoint/_entryAsync.js} (100%) rename javascript/src_js/{entrySync.js => entrypoint/_entrySync.js} (100%) rename javascript/src_js/{variants => entrypoint}/asmjs-async.js (83%) rename javascript/src_js/{variants => entrypoint}/asmjs-sync.js (84%) rename javascript/src_js/{variants => entrypoint}/wasm-async.js (83%) rename javascript/src_js/{variants => entrypoint}/wasm-sync.js (84%) diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml index 93c4fd3c..17ce83ed 100644 --- a/.github/actions/setup-js/action.yml +++ b/.github/actions/setup-js/action.yml @@ -17,5 +17,5 @@ runs: - name: yarn install shell: bash - run: yarn install --frozen-lockfile --ignore-scripts + run: yarn install --frozen-lockfile working-directory: javascript diff --git a/javascript/README.md b/javascript/README.md index 5f6fad3a..952b1323 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -1,6 +1,6 @@ # yoga-layout -This package provides JavaScript bindings for the Yoga layout engine as either WebAssembly (for browsers, Node) or asm.js (other clients or clients unable to read package export maps). +This package provides prebuilt JavaScript bindings for the Yoga layout engine. Both WebAssembly and asm.js variants are packaged, with the optimal loaded based on platform. ## Usage @@ -23,3 +23,30 @@ import Yoga, { ALIGN_CENTER } from "yoga-layout/sync"; const node = Yoga.Node.create(); node.setAlignContent(ALIGN_CENTER); ``` + +## Selecting WebAssembly or asm.js + +For better performance and smaller packages, WebAssembly is preferred to asm.js where available. `yoga-layout` tries to provide the right default using [export maps](https://webpack.js.org/guides/package-exports/#conditional-syntax) so that platforms which can take advantage of WebAssembly use it by default. + +A specific entrypoint may be specified on platforms which do not understand export conditions. + +```ts +import { loadYoga } from "yoga-layout/entrypoint/wasm-async"; +``` + + +## Contributing + +`yoga-layout` may be locally built by running the following set of commands. The build requires that some dependencies be installed first. + +```bash +git clone https://github.com/facebook/yoga.git +cd yoga/javascript +yarn install +yarn build +``` + +### Requirements + +1. CMake >= 3.13 +1. (Optional) ninja, for faster builds diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index e38327c2..7b6b5739 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -9,12 +9,12 @@ module.exports = async () => { if (process.env['SYNC'] == true && process.env['WASM'] == true) { - global.Yoga = require("./dist/variants/wasm-sync"); + global.Yoga = require("./dist/entrypoint/wasm-sync"); } else if (process.env['SYNC'] == true) { - global.Yoga = require("./dist/variants/asmjs-sync"); + global.Yoga = require("./dist/entrypoint/asmjs-sync"); } else if (process.env['WASM'] == true) { - global.Yoga = await require("./dist/variants/wasm-async").loadYoga(); + global.Yoga = await require("./dist/entrypoint/wasm-async").loadYoga(); } else { - global.Yoga = await require("./dist/variants/asmjs-async").loadYoga(); + global.Yoga = await require("./dist/entrypoint/asmjs-async").loadYoga(); } } diff --git a/javascript/package.json b/javascript/package.json index 28bf1849..3fb85e6d 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,7 +1,7 @@ { "name": "yoga-layout", - "version": "1.9.3", - "description": "Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.", + "version": "2.0.0-beta.1", + "description": "JavaScript bindings for the Yoga layout engine", "license": "MIT", "repository": { "type": "git", @@ -11,14 +11,14 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "browser": "./dist/variants/wasm-async.js", - "node": "./dist/variants/wasm-async.js", - "default": "./dist/variants/asmjs-async.js" + "browser": "./dist/entrypoint/wasm-async.js", + "node": "./dist/entrypoint/wasm-async.js", + "default": "./dist/entrypoint/asmjs-async.js" }, "./sync": { - "browser": "./dist/variants/asmjs-sync.js", - "node": "./dist/variants/wasm-sync.js", - "default": "./dist/variants/asmjs-sync.js" + "browser": "./dist/entrypoint/asmjs-sync.js", + "node": "./dist/entrypoint/wasm-sync.js", + "default": "./dist/entrypoint/asmjs-sync.js" } }, "files": [ @@ -32,7 +32,6 @@ "build:copy-dts": "cd src_js && find . -name '*.d.ts' | cpio -pdm ../dist", "build:js": "babel src_js --source-maps --out-dir dist && yarn build:copy-dts", "build:native": "yarn build:configure && cmake --build build", - "postinstall": "yarn build", "test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync", "test:asmjs": "WASM=0 SYNC=0 jest", "test:asmjs-sync": "WASM=0 SYNC=1 jest", diff --git a/javascript/src_js/entryAsync.js b/javascript/src_js/entrypoint/_entryAsync.js similarity index 100% rename from javascript/src_js/entryAsync.js rename to javascript/src_js/entrypoint/_entryAsync.js diff --git a/javascript/src_js/entrySync.js b/javascript/src_js/entrypoint/_entrySync.js similarity index 100% rename from javascript/src_js/entrySync.js rename to javascript/src_js/entrypoint/_entrySync.js diff --git a/javascript/src_js/variants/asmjs-async.js b/javascript/src_js/entrypoint/asmjs-async.js similarity index 83% rename from javascript/src_js/variants/asmjs-async.js rename to javascript/src_js/entrypoint/asmjs-async.js index 02d4097c..11c686cc 100644 --- a/javascript/src_js/variants/asmjs-async.js +++ b/javascript/src_js/entrypoint/asmjs-async.js @@ -8,4 +8,4 @@ */ const asm = require('../build/asmjs-async'); -module.exports = require("../entryAsync")(asm); +module.exports = require("./entryAsync")(asm); diff --git a/javascript/src_js/variants/asmjs-sync.js b/javascript/src_js/entrypoint/asmjs-sync.js similarity index 84% rename from javascript/src_js/variants/asmjs-sync.js rename to javascript/src_js/entrypoint/asmjs-sync.js index 6bcf004f..c165bad9 100644 --- a/javascript/src_js/variants/asmjs-sync.js +++ b/javascript/src_js/entrypoint/asmjs-sync.js @@ -8,4 +8,4 @@ */ const asm = require('../build/asmjs-sync'); -module.exports = require("../entrySync")(asm); +module.exports = require("./entrySync")(asm); diff --git a/javascript/src_js/variants/wasm-async.js b/javascript/src_js/entrypoint/wasm-async.js similarity index 83% rename from javascript/src_js/variants/wasm-async.js rename to javascript/src_js/entrypoint/wasm-async.js index 02906e31..c3a821ea 100644 --- a/javascript/src_js/variants/wasm-async.js +++ b/javascript/src_js/entrypoint/wasm-async.js @@ -8,4 +8,4 @@ */ const asm = require('../build/wasm-async'); -module.exports = require("../entryAsync")(asm); +module.exports = require("./entryAsync")(asm); diff --git a/javascript/src_js/variants/wasm-sync.js b/javascript/src_js/entrypoint/wasm-sync.js similarity index 84% rename from javascript/src_js/variants/wasm-sync.js rename to javascript/src_js/entrypoint/wasm-sync.js index f74af006..1c46a942 100644 --- a/javascript/src_js/variants/wasm-sync.js +++ b/javascript/src_js/entrypoint/wasm-sync.js @@ -8,4 +8,4 @@ */ const asm = require('../build/wasm-sync'); -module.exports = require("../entrySync")(asm); +module.exports = require("./entrySync")(asm); diff --git a/javascript/src_js/index.js b/javascript/src_js/index.js index 2864db0c..06a348c4 100644 --- a/javascript/src_js/index.js +++ b/javascript/src_js/index.js @@ -8,4 +8,4 @@ */ // Fallback for when the export map is not followed -module.exports = require('./variants/asmjs-async'); +module.exports = require('./entrypoint/asmjs-async'); diff --git a/javascript/src_js/sync.js b/javascript/src_js/sync.js index 5a79514e..6ac610ef 100644 --- a/javascript/src_js/sync.js +++ b/javascript/src_js/sync.js @@ -8,4 +8,4 @@ */ // Fallback for when the export map is not followed -module.exports = require('./variants/asmjs-sync'); +module.exports = require('./entrypoint/asmjs-sync'); diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index 02ca7dae..467724a2 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -27,7 +27,7 @@ for (let type of ['asmjs', 'wasm']) { vm.runInNewContext( file, Object.assign(Object.create(global), { - Yoga: require(type === 'asmjs' ? '../dist/variants/asmjs-sync' : '../dist/variants/wasm-sync'), + Yoga: require(type === 'asmjs' ? '../dist/entrypoint/asmjs-sync' : '../dist/entrypoint/wasm-sync'), YGBENCHMARK: function(name, fn) { let testEntry = testResults.get(name); -- 2.50.1.windows.1 From 0f67a0a45883cd3f0b88828466025d1c4f272891 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 00:25:02 -0800 Subject: [PATCH 30/47] Iterate on test setup --- gentest/gentest.rb | 2 +- javascript/README.md | 18 +++++++--- javascript/jest.config.js | 2 +- javascript/package.json | 14 ++++---- javascript/src_js/entrypoint/_entryAsync.js | 4 +-- javascript/src_js/entrypoint/_entrySync.js | 2 +- javascript/src_js/entrypoint/asmjs-async.js | 2 +- javascript/src_js/entrypoint/asmjs-sync.js | 2 +- javascript/src_js/entrypoint/wasm-async.js | 2 +- javascript/src_js/entrypoint/wasm-sync.js | 2 +- .../{YGBenchmark.js => YGBenchmark.test.js} | 5 ++- ...ineTest.js => YGAlignBaselineTest.test.js} | 0 ...erTest.js => YGComputedBorderTest.test.js} | 0 ...inTest.js => YGComputedMarginTest.test.js} | 0 ...gTest.js => YGComputedPaddingTest.test.js} | 0 ...YGDirtiedTest.js => YGDirtiedTest.test.js} | 0 ...acheTest.js => YGMeasureCacheTest.test.js} | 0 ...YGMeasureTest.js => YGMeasureTest.test.js} | 0 .../YGAbsolutePositionTest.test.js} | 0 .../YGAlignContentTest.test.js} | 0 .../YGAlignItemsTest.test.js} | 8 ++--- .../YGAlignSelfTest.test.js} | 0 .../YGAndroidNewsFeed.test.js} | 0 .../YGBorderTest.test.js} | 0 .../YGDimensionTest.test.js} | 0 .../YGDisplayTest.test.js} | 0 .../YGFlexDirectionTest.test.js} | 0 .../YGFlexTest.test.js} | 0 .../YGFlexWrapTest.test.js} | 0 .../YGGapTest.test.js} | 0 .../YGJustifyContentTest.test.js} | 0 .../YGMarginTest.test.js} | 0 .../YGMinMaxDimensionTest.test.js} | 0 .../YGPaddingTest.test.js} | 0 .../YGPercentageTest.test.js} | 0 .../YGRoundingTest.test.js} | 0 .../YGSizeOverflowTest.test.js} | 0 javascript/tests/index.html | 34 ------------------- 38 files changed, 36 insertions(+), 61 deletions(-) rename javascript/tests/Benchmarks/{YGBenchmark.js => YGBenchmark.test.js} (96%) rename javascript/tests/{Facebook.Yoga/YGAlignBaselineTest.js => YGAlignBaselineTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGComputedBorderTest.js => YGComputedBorderTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGComputedMarginTest.js => YGComputedMarginTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGComputedPaddingTest.js => YGComputedPaddingTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGDirtiedTest.js => YGDirtiedTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGMeasureCacheTest.js => YGMeasureCacheTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGMeasureTest.js => YGMeasureTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGAbsolutePositionTest.js => generated/YGAbsolutePositionTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGAlignContentTest.js => generated/YGAlignContentTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGAlignItemsTest.js => generated/YGAlignItemsTest.test.js} (99%) rename javascript/tests/{Facebook.Yoga/YGAlignSelfTest.js => generated/YGAlignSelfTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGAndroidNewsFeed.js => generated/YGAndroidNewsFeed.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGBorderTest.js => generated/YGBorderTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGDimensionTest.js => generated/YGDimensionTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGDisplayTest.js => generated/YGDisplayTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGFlexDirectionTest.js => generated/YGFlexDirectionTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGFlexTest.js => generated/YGFlexTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGFlexWrapTest.js => generated/YGFlexWrapTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGGapTest.js => generated/YGGapTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGJustifyContentTest.js => generated/YGJustifyContentTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGMarginTest.js => generated/YGMarginTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGMinMaxDimensionTest.js => generated/YGMinMaxDimensionTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGPaddingTest.js => generated/YGPaddingTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGPercentageTest.js => generated/YGPercentageTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGRoundingTest.js => generated/YGRoundingTest.test.js} (100%) rename javascript/tests/{Facebook.Yoga/YGSizeOverflowTest.js => generated/YGSizeOverflowTest.test.js} (100%) delete mode 100644 javascript/tests/index.html diff --git a/gentest/gentest.rb b/gentest/gentest.rb index 54481ac3..05f27bbb 100644 --- a/gentest/gentest.rb +++ b/gentest/gentest.rb @@ -56,7 +56,7 @@ Dir['fixtures/*.html'].each do |file| print logs[4] - f = File.open("../javascript/tests/Facebook.Yoga/#{name}.js", 'w') + f = File.open("../javascript/tests/generated/#{name}.test.js", 'w') f.write eval(logs[3].message.sub(/^[^"]*/, '')).sub('YogaTest', name) f.close end diff --git a/javascript/README.md b/javascript/README.md index 952b1323..02c616bb 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -37,7 +37,12 @@ import { loadYoga } from "yoga-layout/entrypoint/wasm-async"; ## Contributing -`yoga-layout` may be locally built by running the following set of commands. The build requires that some dependencies be installed first. +### Requirements + +1. CMake >= 3.13 +1. (Optional) ninja, for faster builds + +### Building ```bash git clone https://github.com/facebook/yoga.git @@ -46,7 +51,12 @@ yarn install yarn build ``` -### Requirements +### Testing -1. CMake >= 3.13 -1. (Optional) ninja, for faster builds +```bash +# Build and test all entrypoints +yarn test + +# Build and test a specific entrypoint +yarn test:asmjs-sync +``` diff --git a/javascript/jest.config.js b/javascript/jest.config.js index 2e962810..80ef40ac 100644 --- a/javascript/jest.config.js +++ b/javascript/jest.config.js @@ -9,6 +9,6 @@ module.exports = { setupFiles: ["./jest.setup.js", "./tests/tools.js"], - testRegex: '/tests/Facebook.Yoga/.*\\.js$', + testRegex: '/tests/.*\\.test\\.js$', watchman: false, } diff --git a/javascript/package.json b/javascript/package.json index 3fb85e6d..aa68f1e8 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -26,17 +26,17 @@ "src_js/**" ], "scripts": { - "benchmark": "node tests/run-bench $(find tests/Benchmarks -name '*.js')", - "build": "yarn build:native && yarn build:js", + "benchmark": "yarn build && node tests/run-bench $(find tests/benchmarks -name '*.js')", + "build": "yarn build:js && yarn build:native", "build:configure": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", "build:copy-dts": "cd src_js && find . -name '*.d.ts' | cpio -pdm ../dist", "build:js": "babel src_js --source-maps --out-dir dist && yarn build:copy-dts", "build:native": "yarn build:configure && cmake --build build", - "test": "yarn test:asmjs && yarn test:asmjs-sync && yarn test:wasm && yarn test:wasm-sync", - "test:asmjs": "WASM=0 SYNC=0 jest", - "test:asmjs-sync": "WASM=0 SYNC=1 jest", - "test:wasm": "WASM=1 SYNC=0 jest", - "test:wasm-sync": "WASM=1 SYNC=1 jest" + "test": "yarn test:asmjs-async && yarn test:asmjs-sync && yarn test:wasm-async && yarn test:wasm-sync", + "test:asmjs-async": "yarn build --target asmjs-async && WASM=0 SYNC=0 jest", + "test:asmjs-sync": "yarn build --target asmjs-sync && WASM=0 SYNC=1 jest", + "test:wasm-async": "yarn build --target wasm-async && WASM=1 SYNC=0 jest", + "test:wasm-sync": "yarn build --target wasm-sync && WASM=1 SYNC=1 jest" }, "devDependencies": { "@babel/cli": "^7.20.7", diff --git a/javascript/src_js/entrypoint/_entryAsync.js b/javascript/src_js/entrypoint/_entryAsync.js index f9957efa..8cb98a65 100644 --- a/javascript/src_js/entrypoint/_entryAsync.js +++ b/javascript/src_js/entrypoint/_entryAsync.js @@ -7,9 +7,9 @@ * @format */ -const wrapAsm = require('./wrapAsm'); +const wrapAsm = require('../wrapAsm'); module.exports = (loadAsm) => ({ loadYoga: () => loadAsm().then(wrapAsm), - ...require('./generated/YGEnums'), + ...require('../generated/YGEnums'), }); diff --git a/javascript/src_js/entrypoint/_entrySync.js b/javascript/src_js/entrypoint/_entrySync.js index b1cfe71c..ae399bbc 100644 --- a/javascript/src_js/entrypoint/_entrySync.js +++ b/javascript/src_js/entrypoint/_entrySync.js @@ -7,5 +7,5 @@ * @format */ - const wrapAsm = require('./wrapAsm'); + const wrapAsm = require('../wrapAsm'); module.exports = (asm) => wrapAsm(asm()); diff --git a/javascript/src_js/entrypoint/asmjs-async.js b/javascript/src_js/entrypoint/asmjs-async.js index 11c686cc..7ca8b3e1 100644 --- a/javascript/src_js/entrypoint/asmjs-async.js +++ b/javascript/src_js/entrypoint/asmjs-async.js @@ -8,4 +8,4 @@ */ const asm = require('../build/asmjs-async'); -module.exports = require("./entryAsync")(asm); +module.exports = require("./_entryAsync")(asm); diff --git a/javascript/src_js/entrypoint/asmjs-sync.js b/javascript/src_js/entrypoint/asmjs-sync.js index c165bad9..b9ff595f 100644 --- a/javascript/src_js/entrypoint/asmjs-sync.js +++ b/javascript/src_js/entrypoint/asmjs-sync.js @@ -8,4 +8,4 @@ */ const asm = require('../build/asmjs-sync'); -module.exports = require("./entrySync")(asm); +module.exports = require("./_entrySync")(asm); diff --git a/javascript/src_js/entrypoint/wasm-async.js b/javascript/src_js/entrypoint/wasm-async.js index c3a821ea..49d246df 100644 --- a/javascript/src_js/entrypoint/wasm-async.js +++ b/javascript/src_js/entrypoint/wasm-async.js @@ -8,4 +8,4 @@ */ const asm = require('../build/wasm-async'); -module.exports = require("./entryAsync")(asm); +module.exports = require("./_entryAsync")(asm); diff --git a/javascript/src_js/entrypoint/wasm-sync.js b/javascript/src_js/entrypoint/wasm-sync.js index 1c46a942..08621891 100644 --- a/javascript/src_js/entrypoint/wasm-sync.js +++ b/javascript/src_js/entrypoint/wasm-sync.js @@ -8,4 +8,4 @@ */ const asm = require('../build/wasm-sync'); -module.exports = require("./entrySync")(asm); +module.exports = require("./_entrySync")(asm); diff --git a/javascript/tests/Benchmarks/YGBenchmark.js b/javascript/tests/Benchmarks/YGBenchmark.test.js similarity index 96% rename from javascript/tests/Benchmarks/YGBenchmark.js rename to javascript/tests/Benchmarks/YGBenchmark.test.js index 296cd365..0ac24814 100644 --- a/javascript/tests/Benchmarks/YGBenchmark.js +++ b/javascript/tests/Benchmarks/YGBenchmark.test.js @@ -5,9 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -var Yoga = Yoga || require("../../dist/entry-" + process.env.TEST_ENTRY); - -var ITERATIONS = 2000; +const ITERATIONS = 2000; +const YGBENCHMARK = global.YGBENCHMARK ?? global.test; YGBENCHMARK("Stack with flex", function() { var root = Yoga.Node.create(); diff --git a/javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js b/javascript/tests/YGAlignBaselineTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGAlignBaselineTest.js rename to javascript/tests/YGAlignBaselineTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js b/javascript/tests/YGComputedBorderTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGComputedBorderTest.js rename to javascript/tests/YGComputedBorderTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js b/javascript/tests/YGComputedMarginTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGComputedMarginTest.js rename to javascript/tests/YGComputedMarginTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js b/javascript/tests/YGComputedPaddingTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js rename to javascript/tests/YGComputedPaddingTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js b/javascript/tests/YGDirtiedTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGDirtiedTest.js rename to javascript/tests/YGDirtiedTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/YGMeasureCacheTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js rename to javascript/tests/YGMeasureCacheTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/YGMeasureTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGMeasureTest.js rename to javascript/tests/YGMeasureTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js rename to javascript/tests/generated/YGAbsolutePositionTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js b/javascript/tests/generated/YGAlignContentTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGAlignContentTest.js rename to javascript/tests/generated/YGAlignContentTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js b/javascript/tests/generated/YGAlignItemsTest.test.js similarity index 99% rename from javascript/tests/Facebook.Yoga/YGAlignItemsTest.js rename to javascript/tests/generated/YGAlignItemsTest.test.js index be25bd46..8f92afec 100644 --- a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -1361,7 +1361,7 @@ it("align_baseline_multiline_column", function () { console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); - console.assert(70 === root_child1.getComputedLeft(), "70 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); + console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); @@ -1371,7 +1371,7 @@ it("align_baseline_multiline_column", function () { console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); + console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); @@ -1481,7 +1481,7 @@ it("align_baseline_multiline_column2", function () { console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); - console.assert(70 === root_child1.getComputedLeft(), "70 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); + console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); @@ -1491,7 +1491,7 @@ it("align_baseline_multiline_column2", function () { console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); + console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); diff --git a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js b/javascript/tests/generated/YGAlignSelfTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGAlignSelfTest.js rename to javascript/tests/generated/YGAlignSelfTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGAndroidNewsFeed.js rename to javascript/tests/generated/YGAndroidNewsFeed.test.js diff --git a/javascript/tests/Facebook.Yoga/YGBorderTest.js b/javascript/tests/generated/YGBorderTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGBorderTest.js rename to javascript/tests/generated/YGBorderTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGDimensionTest.js b/javascript/tests/generated/YGDimensionTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGDimensionTest.js rename to javascript/tests/generated/YGDimensionTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGDisplayTest.js b/javascript/tests/generated/YGDisplayTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGDisplayTest.js rename to javascript/tests/generated/YGDisplayTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js b/javascript/tests/generated/YGFlexDirectionTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js rename to javascript/tests/generated/YGFlexDirectionTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGFlexTest.js b/javascript/tests/generated/YGFlexTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGFlexTest.js rename to javascript/tests/generated/YGFlexTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js b/javascript/tests/generated/YGFlexWrapTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGFlexWrapTest.js rename to javascript/tests/generated/YGFlexWrapTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGGapTest.js b/javascript/tests/generated/YGGapTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGGapTest.js rename to javascript/tests/generated/YGGapTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js b/javascript/tests/generated/YGJustifyContentTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGJustifyContentTest.js rename to javascript/tests/generated/YGJustifyContentTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/generated/YGMarginTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGMarginTest.js rename to javascript/tests/generated/YGMarginTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js rename to javascript/tests/generated/YGMinMaxDimensionTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGPaddingTest.js b/javascript/tests/generated/YGPaddingTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGPaddingTest.js rename to javascript/tests/generated/YGPaddingTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGPercentageTest.js b/javascript/tests/generated/YGPercentageTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGPercentageTest.js rename to javascript/tests/generated/YGPercentageTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/generated/YGRoundingTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGRoundingTest.js rename to javascript/tests/generated/YGRoundingTest.test.js diff --git a/javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js b/javascript/tests/generated/YGSizeOverflowTest.test.js similarity index 100% rename from javascript/tests/Facebook.Yoga/YGSizeOverflowTest.js rename to javascript/tests/generated/YGSizeOverflowTest.test.js diff --git a/javascript/tests/index.html b/javascript/tests/index.html deleted file mode 100644 index dde606d8..00000000 --- a/javascript/tests/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -- 2.50.1.windows.1 From 014986e9da4114e7e9f13813cf8832c70817ad74 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 00:35:10 -0800 Subject: [PATCH 31/47] Modernize generated JS tests --- gentest/gentest-javascript.js | 13 +- javascript/tests/YGAlignBaselineTest.test.js | 24 +- javascript/tests/YGComputedBorderTest.test.js | 2 +- javascript/tests/YGComputedMarginTest.test.js | 2 +- .../tests/YGComputedPaddingTest.test.js | 2 +- javascript/tests/YGDirtiedTest.test.js | 16 +- javascript/tests/YGMeasureCacheTest.test.js | 6 +- javascript/tests/YGMeasureTest.test.js | 6 +- .../generated/YGAbsolutePositionTest.test.js | 930 +++---- .../generated/YGAlignContentTest.test.js | 2056 +++++++-------- .../tests/generated/YGAlignItemsTest.test.js | 2272 ++++++++--------- .../tests/generated/YGAlignSelfTest.test.js | 236 +- .../tests/generated/YGAndroidNewsFeed.test.js | 310 +-- .../tests/generated/YGBorderTest.test.js | 182 +- .../tests/generated/YGDimensionTest.test.js | 98 +- .../tests/generated/YGDisplayTest.test.js | 366 +-- .../generated/YGFlexDirectionTest.test.js | 456 ++-- javascript/tests/generated/YGFlexTest.test.js | 634 ++--- .../tests/generated/YGFlexWrapTest.test.js | 1862 +++++++------- javascript/tests/generated/YGGapTest.test.js | 2118 +++++++-------- .../generated/YGJustifyContentTest.test.js | 1224 ++++----- .../tests/generated/YGMarginTest.test.js | 1698 ++++++------ .../generated/YGMinMaxDimensionTest.test.js | 1212 ++++----- .../tests/generated/YGPaddingTest.test.js | 222 +- .../tests/generated/YGPercentageTest.test.js | 1138 ++++----- .../tests/generated/YGRoundingTest.test.js | 1168 ++++----- .../generated/YGSizeOverflowTest.test.js | 174 +- 27 files changed, 9213 insertions(+), 9214 deletions(-) diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 051049ab..0c07de34 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -var JavascriptEmitter = function() { +const JavascriptEmitter = function() { Emitter.call(this, 'js', ' '); }; @@ -17,9 +17,8 @@ function toValueJavascript(value) { } function toJavascriptUpper(symbol) { - var out = ''; - for (var i = 0; i < symbol.length; i++) { - var c = symbol[i]; + let out = ''; + for (const c of symbol) { if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) { out += '_'; } @@ -36,11 +35,11 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitTestPrologue:{value:function(name, experiments) { this.push('it(' + JSON.stringify(name) + ', function () {'); this.pushIndent(); - this.push('var config = Yoga.Config.create();'); + this.push('const config = Yoga.Config.create();'); this.push(''); if (experiments.length > 0) { - for (var i in experiments) { + for (const i in experiments) { this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiments[i]) + ', true);'); } this.push(''); @@ -51,7 +50,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { }}, emitTestTreePrologue:{value:function(nodeName) { - this.push('var ' + nodeName + ' = Yoga.Node.create(config);'); + this.push('const ' + nodeName + ' = Yoga.Node.create(config);'); }}, emitTestEpilogue:{value:function(experiments) { diff --git a/javascript/tests/YGAlignBaselineTest.test.js b/javascript/tests/YGAlignBaselineTest.test.js index 64d346b0..dd3e8a71 100644 --- a/javascript/tests/YGAlignBaselineTest.test.js +++ b/javascript/tests/YGAlignBaselineTest.test.js @@ -6,34 +6,34 @@ */ it("align_baseline_parent_using_child_in_column_as_reference", function () { - var config = Yoga.Config.create(); + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(1000); root.setHeight(1000); root.setAlignItems(Yoga.ALIGN_BASELINE); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child0.setWidth(500); root_child0.setHeight(600); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1.setWidth(500); root_child1.setHeight(800); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child0.setWidth(500); root_child1_child0.setHeight(300); root_child1.insertChild(root_child1_child0, 0); - var root_child1_child1 = Yoga.Node.create(config); + const root_child1_child1 = Yoga.Node.create(config); root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child1.setWidth(500); root_child1_child1.setHeight(400); @@ -80,34 +80,34 @@ it("align_baseline_parent_using_child_in_column_as_reference", function () { }); it("align_baseline_parent_using_child_in_row_as_reference", function () { - var config = Yoga.Config.create(); + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(1000); root.setHeight(1000); root.setAlignItems(Yoga.ALIGN_BASELINE); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child0.setWidth(500); root_child0.setHeight(600); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child1.setWidth(500); root_child1.setHeight(800); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child0.setWidth(500); root_child1_child0.setHeight(500); root_child1.insertChild(root_child1_child0, 0); - var root_child1_child1 = Yoga.Node.create(config); + const root_child1_child1 = Yoga.Node.create(config); root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN); root_child1_child1.setWidth(500); root_child1_child1.setHeight(400); diff --git a/javascript/tests/YGComputedBorderTest.test.js b/javascript/tests/YGComputedBorderTest.test.js index dc491aad..72dd4c5e 100644 --- a/javascript/tests/YGComputedBorderTest.test.js +++ b/javascript/tests/YGComputedBorderTest.test.js @@ -6,7 +6,7 @@ */ it("border_start", function () { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); root.setBorder(Yoga.EDGE_START, 10); diff --git a/javascript/tests/YGComputedMarginTest.test.js b/javascript/tests/YGComputedMarginTest.test.js index 9b89e9d7..7df2e981 100644 --- a/javascript/tests/YGComputedMarginTest.test.js +++ b/javascript/tests/YGComputedMarginTest.test.js @@ -6,7 +6,7 @@ */ it("margin_start", function () { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); root.setMargin(Yoga.EDGE_START, `10%`); diff --git a/javascript/tests/YGComputedPaddingTest.test.js b/javascript/tests/YGComputedPaddingTest.test.js index d9576450..0adb5061 100644 --- a/javascript/tests/YGComputedPaddingTest.test.js +++ b/javascript/tests/YGComputedPaddingTest.test.js @@ -6,7 +6,7 @@ */ it("padding_start", function () { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); root.setPadding(Yoga.EDGE_START, `10%`); diff --git a/javascript/tests/YGDirtiedTest.test.js b/javascript/tests/YGDirtiedTest.test.js index d6e201cf..7f8c6ced 100644 --- a/javascript/tests/YGDirtiedTest.test.js +++ b/javascript/tests/YGDirtiedTest.test.js @@ -6,7 +6,7 @@ */ it("dirtied", function() { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); @@ -36,19 +36,19 @@ it("dirtied", function() { }); it("dirtied_propagation", function() { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(); + const root_child0 = Yoga.Node.create(); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); root_child0.setMeasureFunc(function() {}); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(); + const root_child1 = Yoga.Node.create(); root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); root_child1.setWidth(50); root_child1.setHeight(20); @@ -77,19 +77,19 @@ it("dirtied_propagation", function() { }); it("dirtied_hierarchy", function() { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(); + const root_child0 = Yoga.Node.create(); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); root_child0.setMeasureFunc(function() {}); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(); + const root_child1 = Yoga.Node.create(); root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); root_child1.setWidth(50); root_child1.setHeight(20); @@ -124,7 +124,7 @@ it("dirtied_hierarchy", function() { }); it("dirtied_reset", function() { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGMeasureCacheTest.test.js b/javascript/tests/YGMeasureCacheTest.test.js index 8b717f58..07c44a43 100644 --- a/javascript/tests/YGMeasureCacheTest.test.js +++ b/javascript/tests/YGMeasureCacheTest.test.js @@ -6,15 +6,15 @@ */ it("measure_once_single_flexible_child", function () { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var measureCounter = getMeasureCounterMax(Yoga); + const measureCounter = getMeasureCounterMax(Yoga); - var root_child0 = Yoga.Node.create(); + const root_child0 = Yoga.Node.create(); root_child0.setMeasureFunc(measureCounter.inc); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); diff --git a/javascript/tests/YGMeasureTest.test.js b/javascript/tests/YGMeasureTest.test.js index 69b02134..331b5ae5 100644 --- a/javascript/tests/YGMeasureTest.test.js +++ b/javascript/tests/YGMeasureTest.test.js @@ -6,13 +6,13 @@ */ it("dont_measure_single_grow_shrink_child", function () { - var root = Yoga.Node.create(); + const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); - var measureCounter = getMeasureCounter(Yoga, null, 100, 100); + const measureCounter = getMeasureCounter(Yoga, null, 100, 100); - var root_child0 = Yoga.Node.create(); + const root_child0 = Yoga.Node.create(); root_child0.setMeasureFunc(measureCounter.inc); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index ce400d29..fbe4bbdf 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -7,15 +7,15 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -it("absolute_layout_width_height_start_top", function () { - var config = Yoga.Config.create(); +test("absolute_layout_width_height_start_top", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_START, 10); root_child0.setPosition(Yoga.EDGE_TOP, 10); @@ -24,27 +24,27 @@ it("absolute_layout_width_height_start_top", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -53,15 +53,15 @@ it("absolute_layout_width_height_start_top", function () { config.free(); } }); -it("absolute_layout_width_height_end_bottom", function () { - var config = Yoga.Config.create(); +test("absolute_layout_width_height_end_bottom", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_END, 10); root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); @@ -70,27 +70,27 @@ it("absolute_layout_width_height_end_bottom", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -99,15 +99,15 @@ it("absolute_layout_width_height_end_bottom", function () { config.free(); } }); -it("absolute_layout_start_top_end_bottom", function () { - var config = Yoga.Config.create(); +test("absolute_layout_start_top_end_bottom", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_START, 10); root_child0.setPosition(Yoga.EDGE_TOP, 10); @@ -116,27 +116,27 @@ it("absolute_layout_start_top_end_bottom", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -145,15 +145,15 @@ it("absolute_layout_start_top_end_bottom", function () { config.free(); } }); -it("absolute_layout_width_height_start_top_end_bottom", function () { - var config = Yoga.Config.create(); +test("absolute_layout_width_height_start_top_end_bottom", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_START, 10); root_child0.setPosition(Yoga.EDGE_TOP, 10); @@ -164,27 +164,27 @@ it("absolute_layout_width_height_start_top_end_bottom", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -193,59 +193,59 @@ it("absolute_layout_width_height_start_top_end_bottom", function () { config.free(); } }); -it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () { - var config = Yoga.Config.create(); +test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setOverflow(Yoga.OVERFLOW_HIDDEN); root.setWidth(50); root.setHeight(50); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_START, 0); root_child0.setPosition(Yoga.EDGE_TOP, 0); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(100); root_child0_child0.setHeight(100); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(50); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(50); - console.assert(-50 === root_child0.getComputedLeft(), "-50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -254,11 +254,11 @@ it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent config.free(); } }); -it("absolute_layout_within_border", function () { - var config = Yoga.Config.create(); +test("absolute_layout_within_border", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setMargin(Yoga.EDGE_LEFT, 10); root.setMargin(Yoga.EDGE_TOP, 10); root.setMargin(Yoga.EDGE_RIGHT, 10); @@ -274,7 +274,7 @@ it("absolute_layout_within_border", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_LEFT, 0); root_child0.setPosition(Yoga.EDGE_TOP, 0); @@ -282,7 +282,7 @@ it("absolute_layout_within_border", function () { root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child1.setPosition(Yoga.EDGE_RIGHT, 0); root_child1.setPosition(Yoga.EDGE_BOTTOM, 0); @@ -290,7 +290,7 @@ it("absolute_layout_within_border", function () { root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child2.setPosition(Yoga.EDGE_LEFT, 0); root_child2.setPosition(Yoga.EDGE_TOP, 0); @@ -302,7 +302,7 @@ it("absolute_layout_within_border", function () { root_child2.setHeight(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child3.setPosition(Yoga.EDGE_RIGHT, 0); root_child3.setPosition(Yoga.EDGE_BOTTOM, 0); @@ -315,57 +315,57 @@ it("absolute_layout_within_border", function () { root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(10 === root.getComputedLeft(), "10 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(10 === root.getComputedTop(), "10 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(10); + expect(root.getComputedTop()).toBe(10); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(30); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(10 === root.getComputedLeft(), "10 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(10 === root.getComputedTop(), "10 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(10); + expect(root.getComputedTop()).toBe(10); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(30); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -374,45 +374,45 @@ it("absolute_layout_within_border", function () { config.free(); } }); -it("absolute_layout_align_items_and_justify_content_center", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_and_justify_content_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -421,45 +421,45 @@ it("absolute_layout_align_items_and_justify_content_center", function () { config.free(); } }); -it("absolute_layout_align_items_and_justify_content_flex_end", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_and_justify_content_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(60 === root_child0.getComputedTop(), "60 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(60); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(60 === root_child0.getComputedTop(), "60 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(60); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -468,44 +468,44 @@ it("absolute_layout_align_items_and_justify_content_flex_end", function () { config.free(); } }); -it("absolute_layout_justify_content_center", function () { - var config = Yoga.Config.create(); +test("absolute_layout_justify_content_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -514,44 +514,44 @@ it("absolute_layout_justify_content_center", function () { config.free(); } }); -it("absolute_layout_align_items_center", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -560,16 +560,16 @@ it("absolute_layout_align_items_center", function () { config.free(); } }); -it("absolute_layout_align_items_center_on_child_only", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_center_on_child_only", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_CENTER); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(60); @@ -577,27 +577,27 @@ it("absolute_layout_align_items_center_on_child_only", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -606,18 +606,18 @@ it("absolute_layout_align_items_center_on_child_only", function () { config.free(); } }); -it("absolute_layout_align_items_and_justify_content_center_and_top_position", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_and_justify_content_center_and_top_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_TOP, 10); root_child0.setWidth(60); @@ -625,27 +625,27 @@ it("absolute_layout_align_items_and_justify_content_center_and_top_position", fu root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -654,18 +654,18 @@ it("absolute_layout_align_items_and_justify_content_center_and_top_position", fu config.free(); } }); -it("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); root_child0.setWidth(60); @@ -673,27 +673,27 @@ it("absolute_layout_align_items_and_justify_content_center_and_bottom_position", root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -702,18 +702,18 @@ it("absolute_layout_align_items_and_justify_content_center_and_bottom_position", config.free(); } }); -it("absolute_layout_align_items_and_justify_content_center_and_left_position", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_and_justify_content_center_and_left_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_LEFT, 5); root_child0.setWidth(60); @@ -721,27 +721,27 @@ it("absolute_layout_align_items_and_justify_content_center_and_left_position", f root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -750,18 +750,18 @@ it("absolute_layout_align_items_and_justify_content_center_and_left_position", f config.free(); } }); -it("absolute_layout_align_items_and_justify_content_center_and_right_position", function () { - var config = Yoga.Config.create(); +test("absolute_layout_align_items_and_justify_content_center_and_right_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_RIGHT, 5); root_child0.setWidth(60); @@ -769,27 +769,27 @@ it("absolute_layout_align_items_and_justify_content_center_and_right_position", root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(110 === root.getComputedWidth(), "110 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(110); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -798,27 +798,27 @@ it("absolute_layout_align_items_and_justify_content_center_and_right_position", config.free(); } }); -it("position_root_with_rtl_should_position_withoutdirection", function () { - var config = Yoga.Config.create(); +test("position_root_with_rtl_should_position_withoutdirection", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_LEFT, 72); root.setWidth(52); root.setHeight(52); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(72 === root.getComputedLeft(), "72 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(72); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(72 === root.getComputedLeft(), "72 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(72); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -827,29 +827,29 @@ it("position_root_with_rtl_should_position_withoutdirection", function () { config.free(); } }); -it("absolute_layout_percentage_bottom_based_on_parent_height", function () { - var config = Yoga.Config.create(); +test("absolute_layout_percentage_bottom_based_on_parent_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_TOP, "50%"); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child1.setPosition(Yoga.EDGE_BOTTOM, "50%"); root_child1.setWidth(10); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child2.setPosition(Yoga.EDGE_TOP, "10%"); root_child2.setPosition(Yoga.EDGE_BOTTOM, "10%"); @@ -857,47 +857,47 @@ it("absolute_layout_percentage_bottom_based_on_parent_height", function () { root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(100); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(90 === root_child1.getComputedTop(), "90 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(90); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(160 === root_child2.getComputedHeight(), "160 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(160); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(100); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(90 === root_child1.getComputedLeft(), "90 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(90 === root_child1.getComputedTop(), "90 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(90); + expect(root_child1.getComputedTop()).toBe(90); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(90 === root_child2.getComputedLeft(), "90 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(160 === root_child2.getComputedHeight(), "160 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(90); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(160); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -906,43 +906,43 @@ it("absolute_layout_percentage_bottom_based_on_parent_height", function () { config.free(); } }); -it("absolute_layout_in_wrap_reverse_column_container", function () { - var config = Yoga.Config.create(); +test("absolute_layout_in_wrap_reverse_column_container", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -951,44 +951,44 @@ it("absolute_layout_in_wrap_reverse_column_container", function () { config.free(); } }); -it("absolute_layout_in_wrap_reverse_row_container", function () { - var config = Yoga.Config.create(); +test("absolute_layout_in_wrap_reverse_row_container", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -997,16 +997,16 @@ it("absolute_layout_in_wrap_reverse_row_container", function () { config.free(); } }); -it("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { - var config = Yoga.Config.create(); +test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(20); @@ -1014,27 +1014,27 @@ it("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1043,17 +1043,17 @@ it("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { config.free(); } }); -it("absolute_layout_in_wrap_reverse_row_container_flex_end", function () { - var config = Yoga.Config.create(); +test("absolute_layout_in_wrap_reverse_row_container_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(20); @@ -1061,27 +1061,27 @@ it("absolute_layout_in_wrap_reverse_row_container_flex_end", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js index 74afca92..8e1802c7 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -7,103 +7,103 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -it("align_content_flex_start", function () { - var config = Yoga.Config.create(); +test("align_content_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(130); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(10); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(10); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(130); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(10); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(20); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(130); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(80); + expect(root_child2.getComputedTop()).toBe(10); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(30); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(80 === root_child4.getComputedLeft(), "80 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(80); + expect(root_child4.getComputedTop()).toBe(20); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -112,99 +112,99 @@ it("align_content_flex_start", function () { config.free(); } }); -it("align_content_flex_start_without_height_on_children", function () { - var config = Yoga.Config.create(); +test("align_content_flex_start_without_height_on_children", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(10); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(10); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(20); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(10); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(20); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -213,105 +213,105 @@ it("align_content_flex_start_without_height_on_children", function () { config.free(); } }); -it("align_content_flex_start_with_flex", function () { - var config = Yoga.Config.create(); +test("align_content_flex_start_with_flex", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(120); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("0%"); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexBasis("0%"); root_child1.setWidth(50); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setFlexGrow(1); root_child3.setFlexShrink(1); root_child3.setFlexBasis("0%"); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(120 === root.getComputedHeight(), "120 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(120); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(40); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(120 === root_child4.getComputedTop(), "120 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(120); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(120 === root.getComputedHeight(), "120 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(120); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(40); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(40); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(120 === root_child4.getComputedTop(), "120 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(120); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -320,103 +320,103 @@ it("align_content_flex_start_with_flex", function () { config.free(); } }); -it("align_content_flex_end", function () { - var config = Yoga.Config.create(); +test("align_content_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(10); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(10); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(40); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(40); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -425,98 +425,98 @@ it("align_content_flex_end", function () { config.free(); } }); -it("align_content_stretch", function () { - var config = Yoga.Config.create(); +test("align_content_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(0); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(100); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(0); - console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(100); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -525,104 +525,104 @@ it("align_content_stretch", function () { config.free(); } }); -it("align_content_spacebetween", function () { - var config = Yoga.Config.create(); +test("align_content_spacebetween", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(130); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(10); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(10); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(130); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(45 === root_child2.getComputedTop(), "45 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(45); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(45 === root_child3.getComputedTop(), "45 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(45); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(90); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(130 === root.getComputedWidth(), "130 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(130); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(45 === root_child2.getComputedTop(), "45 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(80); + expect(root_child2.getComputedTop()).toBe(45); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(45 === root_child3.getComputedTop(), "45 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(30); + expect(root_child3.getComputedTop()).toBe(45); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(80 === root_child4.getComputedLeft(), "80 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(80); + expect(root_child4.getComputedTop()).toBe(90); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -631,104 +631,104 @@ it("align_content_spacebetween", function () { config.free(); } }); -it("align_content_spacearound", function () { - var config = Yoga.Config.create(); +test("align_content_spacearound", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(140); root.setHeight(120); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(10); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(10); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(140 === root.getComputedWidth(), "140 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(120 === root.getComputedHeight(), "120 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(140); + expect(root.getComputedHeight()).toBe(120); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(15); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(15 === root_child1.getComputedTop(), "15 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(15); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(55 === root_child2.getComputedTop(), "55 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(55); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(55 === root_child3.getComputedTop(), "55 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(55); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(95 === root_child4.getComputedTop(), "95 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(95); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(140 === root.getComputedWidth(), "140 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(120 === root.getComputedHeight(), "120 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(140); + expect(root.getComputedHeight()).toBe(120); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(15); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(15 === root_child1.getComputedTop(), "15 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(15); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(90 === root_child2.getComputedLeft(), "90 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(55 === root_child2.getComputedTop(), "55 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(90); + expect(root_child2.getComputedTop()).toBe(55); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(10); - console.assert(40 === root_child3.getComputedLeft(), "40 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(55 === root_child3.getComputedTop(), "55 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(40); + expect(root_child3.getComputedTop()).toBe(55); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(90 === root_child4.getComputedLeft(), "90 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(95 === root_child4.getComputedTop(), "95 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(90); + expect(root_child4.getComputedTop()).toBe(95); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -737,99 +737,99 @@ it("align_content_spacearound", function () { config.free(); } }); -it("align_content_stretch_row", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -838,115 +838,115 @@ it("align_content_stretch_row", function () { config.free(); } }); -it("align_content_stretch_row_with_children", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_children", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0_child0.setFlexBasis("0%"); root_child0.insertChild(root_child0_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -955,105 +955,105 @@ it("align_content_stretch_row_with_children", function () { config.free(); } }); -it("align_content_stretch_row_with_flex", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_flex", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setFlexGrow(1); root_child3.setFlexShrink(1); root_child3.setFlexBasis("0%"); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(100); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(0); + expect(root_child3.getComputedHeight()).toBe(100); - console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(100); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(100); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(100); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(0); + expect(root_child3.getComputedHeight()).toBe(100); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1062,104 +1062,104 @@ it("align_content_stretch_row_with_flex", function () { config.free(); } }); -it("align_content_stretch_row_with_flex_no_shrink", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_flex_no_shrink", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setFlexGrow(1); root_child3.setFlexBasis("0%"); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(100); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(0); + expect(root_child3.getComputedHeight()).toBe(100); - console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(100); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(100); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(100); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(0 === root_child3.getComputedWidth(), "0 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(0); + expect(root_child3.getComputedHeight()).toBe(100); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1168,22 +1168,22 @@ it("align_content_stretch_row_with_flex_no_shrink", function () { config.free(); } }); -it("align_content_stretch_row_with_margin", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setMargin(Yoga.EDGE_LEFT, 10); root_child1.setMargin(Yoga.EDGE_TOP, 10); root_child1.setMargin(Yoga.EDGE_RIGHT, 10); @@ -1191,11 +1191,11 @@ it("align_content_stretch_row_with_margin", function () { root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setMargin(Yoga.EDGE_LEFT, 10); root_child3.setMargin(Yoga.EDGE_TOP, 10); root_child3.setMargin(Yoga.EDGE_RIGHT, 10); @@ -1203,72 +1203,72 @@ it("align_content_stretch_row_with_margin", function () { root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(40); - console.assert(60 === root_child1.getComputedLeft(), "60 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(40 === root_child2.getComputedHeight(), "40 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(40); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(40); - console.assert(60 === root_child3.getComputedLeft(), "60 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(60); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0.getComputedHeight(), "40 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(40); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(40 === root_child2.getComputedHeight(), "40 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(40); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(40); - console.assert(40 === root_child3.getComputedLeft(), "40 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(40); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(100 === root_child4.getComputedLeft(), "100 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(100); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1277,22 +1277,22 @@ it("align_content_stretch_row_with_margin", function () { config.free(); } }); -it("align_content_stretch_row_with_padding", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_padding", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setPadding(Yoga.EDGE_LEFT, 10); root_child1.setPadding(Yoga.EDGE_TOP, 10); root_child1.setPadding(Yoga.EDGE_RIGHT, 10); @@ -1300,11 +1300,11 @@ it("align_content_stretch_row_with_padding", function () { root_child1.setWidth(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setPadding(Yoga.EDGE_LEFT, 10); root_child3.setPadding(Yoga.EDGE_TOP, 10); root_child3.setPadding(Yoga.EDGE_RIGHT, 10); @@ -1312,72 +1312,72 @@ it("align_content_stretch_row_with_padding", function () { root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1386,57 +1386,57 @@ it("align_content_stretch_row_with_padding", function () { config.free(); } }); -it("align_content_stretch_row_with_single_row", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_single_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1445,100 +1445,100 @@ it("align_content_stretch_row_with_single_row", function () { config.free(); } }); -it("align_content_stretch_row_with_fixed_height", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_fixed_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(60); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(80); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(60 === root_child1.getComputedHeight(), "60 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(60); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(80 === root_child2.getComputedHeight(), "80 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(80); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(80); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(60 === root_child1.getComputedHeight(), "60 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(60); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(80 === root_child2.getComputedHeight(), "80 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(80); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1547,100 +1547,100 @@ it("align_content_stretch_row_with_fixed_height", function () { config.free(); } }); -it("align_content_stretch_row_with_max_height", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_max_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setMaxHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(50 === root_child3.getComputedTop(), "50 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(50); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(50 === root_child4.getComputedTop(), "50 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(50); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1649,100 +1649,100 @@ it("align_content_stretch_row_with_max_height", function () { config.free(); } }); -it("align_content_stretch_row_with_min_height", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_row_with_min_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setMinHeight(80); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(90); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(90 === root_child1.getComputedHeight(), "90 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(90); - console.assert(100 === root_child2.getComputedLeft(), "100 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(100); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(90); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(90); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(90); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(90); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(90 === root_child1.getComputedHeight(), "90 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(90); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(90); - console.assert(100 === root_child3.getComputedLeft(), "100 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(10 === root_child3.getComputedHeight(), "10 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(100); + expect(root_child3.getComputedTop()).toBe(90); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(10); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(90 === root_child4.getComputedTop(), "90 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(90); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1751,117 +1751,117 @@ it("align_content_stretch_row_with_min_height", function () { config.free(); } }); -it("align_content_stretch_column", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(150); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0_child0.setFlexBasis("0%"); root_child0.insertChild(root_child0_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(50); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setHeight(50); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(150 === root.getComputedHeight(), "150 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(150); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(100 === root_child3.getComputedTop(), "100 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(100); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(150 === root.getComputedHeight(), "150 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(150); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(100 === root_child3.getComputedTop(), "100 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(100); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(50); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1870,14 +1870,14 @@ it("align_content_stretch_column", function () { config.free(); } }); -it("align_content_stretch_is_not_overriding_align_items", function () { - var config = Yoga.Config.create(); +test("align_content_stretch_is_not_overriding_align_items", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0.setAlignItems(Yoga.ALIGN_CENTER); @@ -1885,44 +1885,44 @@ it("align_content_stretch_is_not_overriding_align_items", function () { root_child0.setHeight(100); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(45 === root_child0_child0.getComputedTop(), "45 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(45); + expect(root_child0_child0.getComputedWidth()).toBe(10); + expect(root_child0_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(90 === root_child0_child0.getComputedLeft(), "90 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(45 === root_child0_child0.getComputedTop(), "45 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(90); + expect(root_child0_child0.getComputedTop()).toBe(45); + expect(root_child0_child0.getComputedWidth()).toBe(10); + expect(root_child0_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index 8f92afec..02ee9df6 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -7,40 +7,40 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -it("align_items_stretch", function () { - var config = Yoga.Config.create(); +test("align_items_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -49,42 +49,42 @@ it("align_items_stretch", function () { config.free(); } }); -it("align_items_center", function () { - var config = Yoga.Config.create(); +test("align_items_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -93,42 +93,42 @@ it("align_items_center", function () { config.free(); } }); -it("align_items_flex_start", function () { - var config = Yoga.Config.create(); +test("align_items_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -137,42 +137,42 @@ it("align_items_flex_start", function () { config.free(); } }); -it("align_items_flex_end", function () { - var config = Yoga.Config.create(); +test("align_items_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -181,58 +181,58 @@ it("align_items_flex_end", function () { config.free(); } }); -it("align_baseline", function () { - var config = Yoga.Config.create(); +test("align_baseline", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -241,73 +241,73 @@ it("align_baseline", function () { config.free(); } }); -it("align_baseline_child", function () { - var config = Yoga.Config.create(); +test("align_baseline_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -316,120 +316,120 @@ it("align_baseline_child", function () { config.free(); } }); -it("align_baseline_child_multiline", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_multiline", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(60); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child1.setFlexWrap(Yoga.WRAP_WRAP); root_child1.setWidth(50); root_child1.setHeight(25); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(25); root_child1_child0.setHeight(20); root_child1.insertChild(root_child1_child0, 0); - var root_child1_child1 = Yoga.Node.create(config); + const root_child1_child1 = Yoga.Node.create(config); root_child1_child1.setWidth(25); root_child1_child1.setHeight(10); root_child1.insertChild(root_child1_child1, 1); - var root_child1_child2 = Yoga.Node.create(config); + const root_child1_child2 = Yoga.Node.create(config); root_child1_child2.setWidth(25); root_child1_child2.setHeight(20); root_child1.insertChild(root_child1_child2, 2); - var root_child1_child3 = Yoga.Node.create(config); + const root_child1_child3 = Yoga.Node.create(config); root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(25); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(25 === root_child1_child1.getComputedLeft(), "25 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(25); + expect(root_child1_child1.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedWidth()).toBe(25); + expect(root_child1_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(0); + expect(root_child1_child2.getComputedTop()).toBe(20); + expect(root_child1_child2.getComputedWidth()).toBe(25); + expect(root_child1_child2.getComputedHeight()).toBe(20); - console.assert(25 === root_child1_child3.getComputedLeft(), "25 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")"); - console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")"); - console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")"); - console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")"); + expect(root_child1_child3.getComputedLeft()).toBe(25); + expect(root_child1_child3.getComputedTop()).toBe(20); + expect(root_child1_child3.getComputedWidth()).toBe(25); + expect(root_child1_child3.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(25 === root_child1_child0.getComputedLeft(), "25 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(25); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(25); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(0); + expect(root_child1_child1.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedWidth()).toBe(25); + expect(root_child1_child1.getComputedHeight()).toBe(10); - console.assert(25 === root_child1_child2.getComputedLeft(), "25 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(25); + expect(root_child1_child2.getComputedTop()).toBe(20); + expect(root_child1_child2.getComputedWidth()).toBe(25); + expect(root_child1_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child3.getComputedLeft(), "0 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")"); - console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")"); - console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")"); - console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")"); + expect(root_child1_child3.getComputedLeft()).toBe(0); + expect(root_child1_child3.getComputedTop()).toBe(20); + expect(root_child1_child3.getComputedWidth()).toBe(25); + expect(root_child1_child3.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -438,122 +438,122 @@ it("align_baseline_child_multiline", function () { config.free(); } }); -it("align_baseline_child_multiline_override", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_multiline_override", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(60); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child1.setFlexWrap(Yoga.WRAP_WRAP); root_child1.setWidth(50); root_child1.setHeight(25); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(25); root_child1_child0.setHeight(20); root_child1.insertChild(root_child1_child0, 0); - var root_child1_child1 = Yoga.Node.create(config); + const root_child1_child1 = Yoga.Node.create(config); root_child1_child1.setAlignSelf(Yoga.ALIGN_BASELINE); root_child1_child1.setWidth(25); root_child1_child1.setHeight(10); root_child1.insertChild(root_child1_child1, 1); - var root_child1_child2 = Yoga.Node.create(config); + const root_child1_child2 = Yoga.Node.create(config); root_child1_child2.setWidth(25); root_child1_child2.setHeight(20); root_child1.insertChild(root_child1_child2, 2); - var root_child1_child3 = Yoga.Node.create(config); + const root_child1_child3 = Yoga.Node.create(config); root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE); root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(25); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(25 === root_child1_child1.getComputedLeft(), "25 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(25); + expect(root_child1_child1.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedWidth()).toBe(25); + expect(root_child1_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(0); + expect(root_child1_child2.getComputedTop()).toBe(20); + expect(root_child1_child2.getComputedWidth()).toBe(25); + expect(root_child1_child2.getComputedHeight()).toBe(20); - console.assert(25 === root_child1_child3.getComputedLeft(), "25 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")"); - console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")"); - console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")"); - console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")"); + expect(root_child1_child3.getComputedLeft()).toBe(25); + expect(root_child1_child3.getComputedTop()).toBe(20); + expect(root_child1_child3.getComputedWidth()).toBe(25); + expect(root_child1_child3.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(25 === root_child1_child0.getComputedLeft(), "25 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(25); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(25); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(0); + expect(root_child1_child1.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedWidth()).toBe(25); + expect(root_child1_child1.getComputedHeight()).toBe(10); - console.assert(25 === root_child1_child2.getComputedLeft(), "25 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(25); + expect(root_child1_child2.getComputedTop()).toBe(20); + expect(root_child1_child2.getComputedWidth()).toBe(25); + expect(root_child1_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child3.getComputedLeft(), "0 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")"); - console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")"); - console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")"); - console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")"); + expect(root_child1_child3.getComputedLeft()).toBe(0); + expect(root_child1_child3.getComputedTop()).toBe(20); + expect(root_child1_child3.getComputedWidth()).toBe(25); + expect(root_child1_child3.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -562,121 +562,121 @@ it("align_baseline_child_multiline_override", function () { config.free(); } }); -it("align_baseline_child_multiline_no_override_on_secondline", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_multiline_no_override_on_secondline", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(60); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child1.setFlexWrap(Yoga.WRAP_WRAP); root_child1.setWidth(50); root_child1.setHeight(25); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(25); root_child1_child0.setHeight(20); root_child1.insertChild(root_child1_child0, 0); - var root_child1_child1 = Yoga.Node.create(config); + const root_child1_child1 = Yoga.Node.create(config); root_child1_child1.setWidth(25); root_child1_child1.setHeight(10); root_child1.insertChild(root_child1_child1, 1); - var root_child1_child2 = Yoga.Node.create(config); + const root_child1_child2 = Yoga.Node.create(config); root_child1_child2.setWidth(25); root_child1_child2.setHeight(20); root_child1.insertChild(root_child1_child2, 2); - var root_child1_child3 = Yoga.Node.create(config); + const root_child1_child3 = Yoga.Node.create(config); root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE); root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(25); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(25 === root_child1_child1.getComputedLeft(), "25 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(25); + expect(root_child1_child1.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedWidth()).toBe(25); + expect(root_child1_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(0); + expect(root_child1_child2.getComputedTop()).toBe(20); + expect(root_child1_child2.getComputedWidth()).toBe(25); + expect(root_child1_child2.getComputedHeight()).toBe(20); - console.assert(25 === root_child1_child3.getComputedLeft(), "25 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")"); - console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")"); - console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")"); - console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")"); + expect(root_child1_child3.getComputedLeft()).toBe(25); + expect(root_child1_child3.getComputedTop()).toBe(20); + expect(root_child1_child3.getComputedWidth()).toBe(25); + expect(root_child1_child3.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(25 === root_child1_child0.getComputedLeft(), "25 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(25 === root_child1_child0.getComputedWidth(), "25 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(25); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(25); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), "0 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(25 === root_child1_child1.getComputedWidth(), "25 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1_child1.getComputedHeight(), "10 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(0); + expect(root_child1_child1.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedWidth()).toBe(25); + expect(root_child1_child1.getComputedHeight()).toBe(10); - console.assert(25 === root_child1_child2.getComputedLeft(), "25 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(20 === root_child1_child2.getComputedTop(), "20 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(25 === root_child1_child2.getComputedWidth(), "25 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(20 === root_child1_child2.getComputedHeight(), "20 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(25); + expect(root_child1_child2.getComputedTop()).toBe(20); + expect(root_child1_child2.getComputedWidth()).toBe(25); + expect(root_child1_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child3.getComputedLeft(), "0 === root_child1_child3.getComputedLeft() (" + root_child1_child3.getComputedLeft() + ")"); - console.assert(20 === root_child1_child3.getComputedTop(), "20 === root_child1_child3.getComputedTop() (" + root_child1_child3.getComputedTop() + ")"); - console.assert(25 === root_child1_child3.getComputedWidth(), "25 === root_child1_child3.getComputedWidth() (" + root_child1_child3.getComputedWidth() + ")"); - console.assert(10 === root_child1_child3.getComputedHeight(), "10 === root_child1_child3.getComputedHeight() (" + root_child1_child3.getComputedHeight() + ")"); + expect(root_child1_child3.getComputedLeft()).toBe(0); + expect(root_child1_child3.getComputedTop()).toBe(20); + expect(root_child1_child3.getComputedWidth()).toBe(25); + expect(root_child1_child3.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -685,74 +685,74 @@ it("align_baseline_child_multiline_no_override_on_secondline", function () { config.free(); } }); -it("align_baseline_child_top", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_top", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPosition(Yoga.EDGE_TOP, 10); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -761,74 +761,74 @@ it("align_baseline_child_top", function () { config.free(); } }); -it("align_baseline_child_top2", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_top2", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setPosition(Yoga.EDGE_TOP, 5); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(45 === root_child1.getComputedTop(), "45 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(45); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(45 === root_child1.getComputedTop(), "45 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(45); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -837,88 +837,88 @@ it("align_baseline_child_top2", function () { config.free(); } }); -it("align_baseline_double_nested_child", function () { - var config = Yoga.Config.create(); +test("align_baseline_double_nested_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(50); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(15); root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(5); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(15 === root_child1_child0.getComputedHeight(), "15 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(15); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(5); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(15 === root_child1_child0.getComputedHeight(), "15 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(15); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -927,57 +927,57 @@ it("align_baseline_double_nested_child", function () { config.free(); } }); -it("align_baseline_column", function () { - var config = Yoga.Config.create(); +test("align_baseline_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -986,17 +986,17 @@ it("align_baseline_column", function () { config.free(); } }); -it("align_baseline_child_margin", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, 5); root_child0.setMargin(Yoga.EDGE_TOP, 5); root_child0.setMargin(Yoga.EDGE_RIGHT, 5); @@ -1005,12 +1005,12 @@ it("align_baseline_child_margin", function () { root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setMargin(Yoga.EDGE_LEFT, 1); root_child1_child0.setMargin(Yoga.EDGE_TOP, 1); root_child1_child0.setMargin(Yoga.EDGE_RIGHT, 1); @@ -1020,47 +1020,47 @@ it("align_baseline_child_margin", function () { root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(5); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(60 === root_child1.getComputedLeft(), "60 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(44 === root_child1.getComputedTop(), "44 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(44); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(1 === root_child1_child0.getComputedLeft(), "1 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(1 === root_child1_child0.getComputedTop(), "1 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(1); + expect(root_child1_child0.getComputedTop()).toBe(1); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(5); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(-10 === root_child1.getComputedLeft(), "-10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(44 === root_child1.getComputedTop(), "44 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(-10); + expect(root_child1.getComputedTop()).toBe(44); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(-1 === root_child1_child0.getComputedLeft(), "-1 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(1 === root_child1_child0.getComputedTop(), "1 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(-1); + expect(root_child1_child0.getComputedTop()).toBe(1); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1069,11 +1069,11 @@ it("align_baseline_child_margin", function () { config.free(); } }); -it("align_baseline_child_padding", function () { - var config = Yoga.Config.create(); +test("align_baseline_child_padding", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setPadding(Yoga.EDGE_LEFT, 5); @@ -1083,12 +1083,12 @@ it("align_baseline_child_padding", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setPadding(Yoga.EDGE_LEFT, 5); root_child1.setPadding(Yoga.EDGE_TOP, 5); root_child1.setPadding(Yoga.EDGE_RIGHT, 5); @@ -1097,53 +1097,53 @@ it("align_baseline_child_padding", function () { root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(5); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(55 === root_child1.getComputedLeft(), "55 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(55); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(5 === root_child1_child0.getComputedLeft(), "5 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(5 === root_child1_child0.getComputedTop(), "5 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(5); + expect(root_child1_child0.getComputedTop()).toBe(5); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(5); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(-5 === root_child1.getComputedLeft(), "-5 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(-5); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(-5 === root_child1_child0.getComputedLeft(), "-5 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(5 === root_child1_child0.getComputedTop(), "5 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(-5); + expect(root_child1_child0.getComputedTop()).toBe(5); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1152,119 +1152,119 @@ it("align_baseline_child_padding", function () { config.free(); } }); -it("align_baseline_multiline", function () { - var config = Yoga.Config.create(); +test("align_baseline_multiline", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child2_child0 = Yoga.Node.create(config); + const root_child2_child0 = Yoga.Node.create(config); root_child2_child0.setWidth(50); root_child2_child0.setHeight(10); root_child2.insertChild(root_child2_child0, 0); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(50); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(100); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(0); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(50); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(60); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(100); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(0); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(50); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(50 === root_child3.getComputedHeight(), "50 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(60); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1273,118 +1273,118 @@ it("align_baseline_multiline", function () { config.free(); } }); -it("align_baseline_multiline_column", function () { - var config = Yoga.Config.create(); +test("align_baseline_multiline_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(20); root_child1_child0.setHeight(20); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(40); root_child2.setHeight(70); root.insertChild(root_child2, 2); - var root_child2_child0 = Yoga.Node.create(config); + const root_child2_child0 = Yoga.Node.create(config); root_child2_child0.setWidth(10); root_child2_child0.setHeight(10); root_child2.insertChild(root_child2_child0, 0); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(20); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(40); + expect(root_child2.getComputedHeight()).toBe(70); - console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(0); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(10); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(70); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(70); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(10 === root_child1_child0.getComputedLeft(), "10 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(10); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(20); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(40); + expect(root_child2.getComputedHeight()).toBe(70); - console.assert(30 === root_child2_child0.getComputedLeft(), "30 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(30); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(10); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(70); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1393,118 +1393,118 @@ it("align_baseline_multiline_column", function () { config.free(); } }); -it("align_baseline_multiline_column2", function () { - var config = Yoga.Config.create(); +test("align_baseline_multiline_column2", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(20); root_child1_child0.setHeight(20); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(40); root_child2.setHeight(70); root.insertChild(root_child2, 2); - var root_child2_child0 = Yoga.Node.create(config); + const root_child2_child0 = Yoga.Node.create(config); root_child2_child0.setWidth(10); root_child2_child0.setHeight(10); root_child2.insertChild(root_child2_child0, 0); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(20); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(40); + expect(root_child2.getComputedHeight()).toBe(70); - console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(0); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(10); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(70); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(70); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(10 === root_child1_child0.getComputedLeft(), "10 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(20 === root_child1_child0.getComputedWidth(), "20 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(20 === root_child1_child0.getComputedHeight(), "20 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(10); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(20); + expect(root_child1_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(40 === root_child2.getComputedWidth(), "40 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(70 === root_child2.getComputedHeight(), "70 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(40); + expect(root_child2.getComputedHeight()).toBe(70); - console.assert(30 === root_child2_child0.getComputedLeft(), "30 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(10 === root_child2_child0.getComputedWidth(), "10 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(30); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(10); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(70); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1513,119 +1513,119 @@ it("align_baseline_multiline_column2", function () { config.free(); } }); -it("align_baseline_multiline_row_and_column", function () { - var config = Yoga.Config.create(); +test("align_baseline_multiline_row_and_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child2_child0 = Yoga.Node.create(config); + const root_child2_child0 = Yoga.Node.create(config); root_child2_child0.setWidth(50); root_child2_child0.setHeight(10); root_child2.insertChild(root_child2_child0, 0); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(100); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(0); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(50); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child3.getComputedLeft(), "50 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(50); + expect(root_child3.getComputedTop()).toBe(90); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(100 === root_child2.getComputedTop(), "100 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(100); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child2_child0.getComputedLeft(), "0 === root_child2_child0.getComputedLeft() (" + root_child2_child0.getComputedLeft() + ")"); - console.assert(0 === root_child2_child0.getComputedTop(), "0 === root_child2_child0.getComputedTop() (" + root_child2_child0.getComputedTop() + ")"); - console.assert(50 === root_child2_child0.getComputedWidth(), "50 === root_child2_child0.getComputedWidth() (" + root_child2_child0.getComputedWidth() + ")"); - console.assert(10 === root_child2_child0.getComputedHeight(), "10 === root_child2_child0.getComputedHeight() (" + root_child2_child0.getComputedHeight() + ")"); + expect(root_child2_child0.getComputedLeft()).toBe(0); + expect(root_child2_child0.getComputedTop()).toBe(0); + expect(root_child2_child0.getComputedWidth()).toBe(50); + expect(root_child2_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(90 === root_child3.getComputedTop(), "90 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(50 === root_child3.getComputedWidth(), "50 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(90); + expect(root_child3.getComputedWidth()).toBe(50); + expect(root_child3.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1634,21 +1634,21 @@ it("align_baseline_multiline_row_and_column", function () { config.free(); } }); -it("align_items_center_child_with_margin_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("align_items_center_child_with_margin_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignItems(Yoga.ALIGN_CENTER); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10); root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10); root_child0_child0.setWidth(52); @@ -1656,37 +1656,37 @@ it("align_items_center_child_with_margin_bigger_than_parent", function () { root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(52); - console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(10); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(52); + expect(root_child0_child0.getComputedHeight()).toBe(52); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(52); - console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(10); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(52); + expect(root_child0_child0.getComputedHeight()).toBe(52); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1695,21 +1695,21 @@ it("align_items_center_child_with_margin_bigger_than_parent", function () { config.free(); } }); -it("align_items_flex_end_child_with_margin_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignItems(Yoga.ALIGN_FLEX_END); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10); root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10); root_child0_child0.setWidth(52); @@ -1717,37 +1717,37 @@ it("align_items_flex_end_child_with_margin_bigger_than_parent", function () { root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(52); - console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(10); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(52); + expect(root_child0_child0.getComputedHeight()).toBe(52); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0.getComputedHeight(), "52 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(52); - console.assert(10 === root_child0_child0.getComputedLeft(), "10 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(52 === root_child0_child0.getComputedWidth(), "52 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(52 === root_child0_child0.getComputedHeight(), "52 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(10); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(52); + expect(root_child0_child0.getComputedHeight()).toBe(52); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1756,57 +1756,57 @@ it("align_items_flex_end_child_with_margin_bigger_than_parent", function () { config.free(); } }); -it("align_items_center_child_without_margin_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("align_items_center_child_without_margin_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignItems(Yoga.ALIGN_CENTER); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(72); root_child0_child0.setHeight(72); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0.getComputedHeight()).toBe(72); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0.getComputedHeight()).toBe(72); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1815,57 +1815,57 @@ it("align_items_center_child_without_margin_bigger_than_parent", function () { config.free(); } }); -it("align_items_flex_end_child_without_margin_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("align_items_flex_end_child_without_margin_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignItems(Yoga.ALIGN_FLEX_END); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(72); root_child0_child0.setHeight(72); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0.getComputedHeight()).toBe(72); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-10 === root_child0.getComputedLeft(), "-10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-10); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0.getComputedWidth(), "72 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0.getComputedHeight(), "72 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0.getComputedHeight()).toBe(72); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1874,73 +1874,73 @@ it("align_items_flex_end_child_without_margin_bigger_than_parent", function () { config.free(); } }); -it("align_center_should_size_based_on_content", function () { - var config = Yoga.Config.create(); +test("align_center_should_size_based_on_content", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setMargin(Yoga.EDGE_TOP, 20); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); root_child0.setFlexShrink(1); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setWidth(20); root_child0_child0_child0.setHeight(20); root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(20); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(20 === root_child0_child0.getComputedWidth(), "20 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(20); + expect(root_child0_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(20); + expect(root_child0_child0_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(20); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(20 === root_child0_child0.getComputedWidth(), "20 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(20); + expect(root_child0_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(20); + expect(root_child0_child0_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1949,72 +1949,72 @@ it("align_center_should_size_based_on_content", function () { config.free(); } }); -it("align_stretch_should_size_based_on_parent", function () { - var config = Yoga.Config.create(); +test("align_stretch_should_size_based_on_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setMargin(Yoga.EDGE_TOP, 20); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); root_child0.setFlexShrink(1); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setWidth(20); root_child0_child0_child0.setHeight(20); root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(20); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(20); + expect(root_child0_child0_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(20 === root.getComputedTop(), "20 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(20); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(20); - console.assert(80 === root_child0_child0_child0.getComputedLeft(), "80 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedWidth(), "20 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0_child0.getComputedHeight(), "20 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(80); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(20); + expect(root_child0_child0_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -2023,70 +2023,70 @@ it("align_stretch_should_size_based_on_parent", function () { config.free(); } }); -it("align_flex_start_with_shrinking_children", function () { - var config = Yoga.Config.create(); +test("align_flex_start_with_shrinking_children", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(500); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(500); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(500 === root_child0_child0.getComputedLeft(), "500 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(500); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -2095,69 +2095,69 @@ it("align_flex_start_with_shrinking_children", function () { config.free(); } }); -it("align_flex_start_with_stretching_children", function () { - var config = Yoga.Config.create(); +test("align_flex_start_with_stretching_children", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(500); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(500); + expect(root_child0_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(500 === root_child0_child0_child0.getComputedWidth(), "500 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(500); + expect(root_child0_child0_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(500); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(500); + expect(root_child0_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(500 === root_child0_child0_child0.getComputedWidth(), "500 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(500); + expect(root_child0_child0_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -2166,70 +2166,70 @@ it("align_flex_start_with_stretching_children", function () { config.free(); } }); -it("align_flex_start_with_shrinking_children_with_stretch", function () { - var config = Yoga.Config.create(); +test("align_flex_start_with_shrinking_children_with_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(500); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(500 === root_child0.getComputedWidth(), "500 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(500); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(500 === root_child0_child0.getComputedLeft(), "500 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(500); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedWidth(), "0 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedHeight(), "0 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index 554c2e1d..da288597 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -7,42 +7,42 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -it("align_self_center", function () { - var config = Yoga.Config.create(); +test("align_self_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_CENTER); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -51,42 +51,42 @@ it("align_self_center", function () { config.free(); } }); -it("align_self_flex_end", function () { - var config = Yoga.Config.create(); +test("align_self_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -95,42 +95,42 @@ it("align_self_flex_end", function () { config.free(); } }); -it("align_self_flex_start", function () { - var config = Yoga.Config.create(); +test("align_self_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_START); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -139,43 +139,43 @@ it("align_self_flex_start", function () { config.free(); } }); -it("align_self_flex_end_override_flex_start", function () { - var config = Yoga.Config.create(); +test("align_self_flex_end_override_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -184,74 +184,74 @@ it("align_self_flex_end_override_flex_start", function () { config.free(); } }); -it("align_self_baseline", function () { - var config = Yoga.Config.create(); +test("align_self_baseline", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setAlignSelf(Yoga.ALIGN_BASELINE); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setAlignSelf(Yoga.ALIGN_BASELINE); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(50 === root_child1_child0.getComputedWidth(), "50 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(50); + expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index c18a3b8e..a553a786 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -7,26 +7,26 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -it("android_news_feed", function () { - var config = Yoga.Config.create(); +test("android_news_feed", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setWidth(1080); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0.insertChild(root_child0_child0_child0, 0); - var root_child0_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START); @@ -34,18 +34,18 @@ it("android_news_feed", function () { root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24); root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0); - var root_child0_child0_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0); - var root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child0_child0.setWidth(120); root_child0_child0_child0_child0_child0_child0.setHeight(120); root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0); - var root_child0_child0_child0_child0_child1 = Yoga.Node.create(config); + const root_child0_child0_child0_child0_child1 = Yoga.Node.create(config); root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child1.setFlexShrink(1); root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36); @@ -55,22 +55,22 @@ it("android_news_feed", function () { root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18); root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1); - var root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config); + const root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config); root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child1_child0.setFlexShrink(1); root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0); - var root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config); + const root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config); root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0_child0_child1_child1.setFlexShrink(1); root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1); - var root_child0_child0_child1 = Yoga.Node.create(config); + const root_child0_child0_child1 = Yoga.Node.create(config); root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0.insertChild(root_child0_child0_child1, 1); - var root_child0_child0_child1_child0 = Yoga.Node.create(config); + const root_child0_child0_child1_child0 = Yoga.Node.create(config); root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START); @@ -78,18 +78,18 @@ it("android_news_feed", function () { root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24); root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0); - var root_child0_child0_child1_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child1_child0_child0 = Yoga.Node.create(config); root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0); - var root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child0_child0.setWidth(72); root_child0_child0_child1_child0_child0_child0.setHeight(72); root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0); - var root_child0_child0_child1_child0_child1 = Yoga.Node.create(config); + const root_child0_child0_child1_child0_child1 = Yoga.Node.create(config); root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1.setFlexShrink(1); root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36); @@ -99,189 +99,189 @@ it("android_news_feed", function () { root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18); root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1); - var root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config); + const root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config); root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1_child0.setFlexShrink(1); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0); - var root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config); + const root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config); root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1_child1.setFlexShrink(1); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(240 === root.getComputedHeight(), "240 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(1080); + expect(root.getComputedHeight()).toBe(240); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(1080); + expect(root_child0.getComputedHeight()).toBe(240); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(1080); + expect(root_child0_child0.getComputedHeight()).toBe(240); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(1080); + expect(root_child0_child0_child0.getComputedHeight()).toBe(144); - console.assert(36 === root_child0_child0_child0_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")"); - console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")"); - console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0.getComputedLeft()).toBe(36); + expect(root_child0_child0_child0_child0.getComputedTop()).toBe(24); + expect(root_child0_child0_child0_child0.getComputedWidth()).toBe(1044); + expect(root_child0_child0_child0_child0.getComputedHeight()).toBe(120); - console.assert(0 === root_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120); + expect(root_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120); - console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120); + expect(root_child0_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120); - console.assert(120 === root_child0_child0_child0_child0_child1.getComputedLeft(), "120 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")"); - console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child1.getComputedLeft()).toBe(120); + expect(root_child0_child0_child0_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child0_child0_child0_child1.getComputedWidth()).toBe(72); + expect(root_child0_child0_child0_child0_child1.getComputedHeight()).toBe(39); - console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child1_child0.getComputedLeft()).toBe(36); + expect(root_child0_child0_child0_child0_child1_child0.getComputedTop()).toBe(21); + expect(root_child0_child0_child0_child0_child1_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0_child0_child1_child0.getComputedHeight()).toBe(0); - console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child1_child1.getComputedLeft()).toBe(36); + expect(root_child0_child0_child0_child0_child1_child1.getComputedTop()).toBe(21); + expect(root_child0_child0_child0_child0_child1_child1.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0_child0_child1_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")"); - console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")"); - console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")"); - console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1.getComputedTop()).toBe(144); + expect(root_child0_child0_child1.getComputedWidth()).toBe(1080); + expect(root_child0_child0_child1.getComputedHeight()).toBe(96); - console.assert(174 === root_child0_child0_child1_child0.getComputedLeft(), "174 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")"); - console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")"); - console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0.getComputedLeft()).toBe(174); + expect(root_child0_child0_child1_child0.getComputedTop()).toBe(24); + expect(root_child0_child0_child1_child0.getComputedWidth()).toBe(906); + expect(root_child0_child0_child1_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0_child1_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child1_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0_child1_child0_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child1_child0_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0_child1_child0_child0_child0.getComputedHeight()).toBe(72); - console.assert(72 === root_child0_child0_child1_child0_child1.getComputedLeft(), "72 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")"); - console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child1.getComputedLeft()).toBe(72); + expect(root_child0_child0_child1_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child0_child1_child0_child1.getComputedWidth()).toBe(72); + expect(root_child0_child0_child1_child0_child1.getComputedHeight()).toBe(39); - console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child1_child0.getComputedLeft()).toBe(36); + expect(root_child0_child0_child1_child0_child1_child0.getComputedTop()).toBe(21); + expect(root_child0_child0_child1_child0_child1_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child1_child0_child1_child0.getComputedHeight()).toBe(0); - console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child1_child1.getComputedLeft()).toBe(36); + expect(root_child0_child0_child1_child0_child1_child1.getComputedTop()).toBe(21); + expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0); + expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(240 === root.getComputedHeight(), "240 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(1080); + expect(root.getComputedHeight()).toBe(240); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(240 === root_child0.getComputedHeight(), "240 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(1080); + expect(root_child0.getComputedHeight()).toBe(240); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0_child0.getComputedWidth(), "1080 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(240 === root_child0_child0.getComputedHeight(), "240 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(1080); + expect(root_child0_child0.getComputedHeight()).toBe(240); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0_child0_child0.getComputedWidth(), "1080 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(144 === root_child0_child0_child0.getComputedHeight(), "144 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(1080); + expect(root_child0_child0_child0.getComputedHeight()).toBe(144); - console.assert(0 === root_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0.getComputedLeft() + ")"); - console.assert(24 === root_child0_child0_child0_child0.getComputedTop(), "24 === root_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0.getComputedTop() + ")"); - console.assert(1044 === root_child0_child0_child0_child0.getComputedWidth(), "1044 === root_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0_child0.getComputedTop()).toBe(24); + expect(root_child0_child0_child0_child0.getComputedWidth()).toBe(1044); + expect(root_child0_child0_child0_child0.getComputedHeight()).toBe(120); - console.assert(924 === root_child0_child0_child0_child0_child0.getComputedLeft(), "924 === root_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0.getComputedTop() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child0.getComputedLeft()).toBe(924); + expect(root_child0_child0_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120); + expect(root_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120); - console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0_child0_child0_child0.getComputedTop() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child0_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight(), "120 === root_child0_child0_child0_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0_child0_child0_child0.getComputedWidth()).toBe(120); + expect(root_child0_child0_child0_child0_child0_child0.getComputedHeight()).toBe(120); - console.assert(816 === root_child0_child0_child0_child0_child1.getComputedLeft(), "816 === root_child0_child0_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child0_child0_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child0_child0_child1.getComputedWidth(), "72 === root_child0_child0_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1.getComputedWidth() + ")"); - console.assert(39 === root_child0_child0_child0_child0_child1.getComputedHeight(), "39 === root_child0_child0_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child1.getComputedLeft()).toBe(816); + expect(root_child0_child0_child0_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child0_child0_child0_child1.getComputedWidth()).toBe(72); + expect(root_child0_child0_child0_child0_child1.getComputedHeight()).toBe(39); - console.assert(36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child0.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child0_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child0_child0_child1_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child1_child0.getComputedLeft()).toBe(36); + expect(root_child0_child0_child0_child0_child1_child0.getComputedTop()).toBe(21); + expect(root_child0_child0_child0_child0_child1_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0_child0_child1_child0.getComputedHeight()).toBe(0); - console.assert(36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child0_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child0_child0_child1_child1.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child0_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child0_child0_child1_child1.getComputedTop() (" + root_child0_child0_child0_child0_child1_child1.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child0_child0_child1_child1.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child0_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child0_child0_child1_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child0_child0_child1_child1.getComputedLeft()).toBe(36); + expect(root_child0_child0_child0_child0_child1_child1.getComputedTop()).toBe(21); + expect(root_child0_child0_child0_child0_child1_child1.getComputedWidth()).toBe(0); + expect(root_child0_child0_child0_child0_child1_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")"); - console.assert(144 === root_child0_child0_child1.getComputedTop(), "144 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")"); - console.assert(1080 === root_child0_child0_child1.getComputedWidth(), "1080 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")"); - console.assert(96 === root_child0_child0_child1.getComputedHeight(), "96 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1.getComputedTop()).toBe(144); + expect(root_child0_child0_child1.getComputedWidth()).toBe(1080); + expect(root_child0_child0_child1.getComputedHeight()).toBe(96); - console.assert(0 === root_child0_child0_child1_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0.getComputedLeft() + ")"); - console.assert(24 === root_child0_child0_child1_child0.getComputedTop(), "24 === root_child0_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0.getComputedTop() + ")"); - console.assert(906 === root_child0_child0_child1_child0.getComputedWidth(), "906 === root_child0_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0_child1_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1_child0.getComputedTop()).toBe(24); + expect(root_child0_child0_child1_child0.getComputedWidth()).toBe(906); + expect(root_child0_child0_child1_child0.getComputedHeight()).toBe(72); - console.assert(834 === root_child0_child0_child1_child0_child0.getComputedLeft(), "834 === root_child0_child0_child1_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child0.getComputedLeft()).toBe(834); + expect(root_child0_child0_child1_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child1_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0_child1_child0_child0.getComputedHeight()).toBe(72); - console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child1_child0_child0_child0.getComputedTop() (" + root_child0_child0_child1_child0_child0_child0.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child0_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight(), "72 === root_child0_child0_child1_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child1_child0_child0_child0.getComputedWidth()).toBe(72); + expect(root_child0_child0_child1_child0_child0_child0.getComputedHeight()).toBe(72); - console.assert(726 === root_child0_child0_child1_child0_child1.getComputedLeft(), "726 === root_child0_child0_child1_child0_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1.getComputedTop(), "0 === root_child0_child0_child1_child0_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1.getComputedTop() + ")"); - console.assert(72 === root_child0_child0_child1_child0_child1.getComputedWidth(), "72 === root_child0_child0_child1_child0_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1.getComputedWidth() + ")"); - console.assert(39 === root_child0_child0_child1_child0_child1.getComputedHeight(), "39 === root_child0_child0_child1_child0_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child1.getComputedLeft()).toBe(726); + expect(root_child0_child0_child1_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child0_child1_child0_child1.getComputedWidth()).toBe(72); + expect(root_child0_child0_child1_child0_child1.getComputedHeight()).toBe(39); - console.assert(36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child0.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child0.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child1_child0_child1_child0.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child0.getComputedTop() (" + root_child0_child0_child1_child0_child1_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child0.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child1_child0.getComputedLeft()).toBe(36); + expect(root_child0_child0_child1_child0_child1_child0.getComputedTop()).toBe(21); + expect(root_child0_child0_child1_child0_child1_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0_child1_child0_child1_child0.getComputedHeight()).toBe(0); - console.assert(36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft(), "36 === root_child0_child0_child1_child0_child1_child1.getComputedLeft() (" + root_child0_child0_child1_child0_child1_child1.getComputedLeft() + ")"); - console.assert(21 === root_child0_child0_child1_child0_child1_child1.getComputedTop(), "21 === root_child0_child0_child1_child0_child1_child1.getComputedTop() (" + root_child0_child0_child1_child0_child1_child1.getComputedTop() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedWidth() (" + root_child0_child0_child1_child0_child1_child1.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight(), "0 === root_child0_child0_child1_child0_child1_child1.getComputedHeight() (" + root_child0_child0_child1_child0_child1_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1_child0_child1_child1.getComputedLeft()).toBe(36); + expect(root_child0_child0_child1_child0_child1_child1.getComputedTop()).toBe(21); + expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0); + expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index 9f2e2034..74cf6b54 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -7,28 +7,28 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -it("border_no_size", function () { - var config = Yoga.Config.create(); +test("border_no_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_BOTTOM, 10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -37,43 +37,43 @@ it("border_no_size", function () { config.free(); } }); -it("border_container_match_child", function () { - var config = Yoga.Config.create(); +test("border_container_match_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_BOTTOM, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(30); + expect(root.getComputedHeight()).toBe(30); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(30); + expect(root.getComputedHeight()).toBe(30); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -82,11 +82,11 @@ it("border_container_match_child", function () { config.free(); } }); -it("border_flex_child", function () { - var config = Yoga.Config.create(); +test("border_flex_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); @@ -94,33 +94,33 @@ it("border_flex_child", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -129,11 +129,11 @@ it("border_flex_child", function () { config.free(); } }); -it("border_stretch_child", function () { - var config = Yoga.Config.create(); +test("border_stretch_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); @@ -141,32 +141,32 @@ it("border_stretch_child", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -175,11 +175,11 @@ it("border_stretch_child", function () { config.free(); } }); -it("border_center_child", function () { - var config = Yoga.Config.create(); +test("border_center_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setBorder(Yoga.EDGE_START, 10); @@ -188,33 +188,33 @@ it("border_center_child", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(35); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(35); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index 580e6f46..edf74109 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -7,39 +7,39 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -it("wrap_child", function () { - var config = Yoga.Config.create(); +test("wrap_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -48,52 +48,52 @@ it("wrap_child", function () { config.free(); } }); -it("wrap_grandchild", function () { - var config = Yoga.Config.create(); +test("wrap_grandchild", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(100); root_child0_child0.setHeight(100); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index 62bc100a..f1d50ff6 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -7,56 +7,56 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -it("display_none", function () { - var config = Yoga.Config.create(); +test("display_none", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -65,57 +65,57 @@ it("display_none", function () { config.free(); } }); -it("display_none_fixed_size", function () { - var config = Yoga.Config.create(); +test("display_none_fixed_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -124,16 +124,16 @@ it("display_none_fixed_size", function () { config.free(); } }); -it("display_none_with_margin", function () { - var config = Yoga.Config.create(); +test("display_none_with_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, 10); root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setMargin(Yoga.EDGE_RIGHT, 10); @@ -143,42 +143,42 @@ it("display_none_with_margin", function () { root_child0.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -187,93 +187,93 @@ it("display_none_with_margin", function () { config.free(); } }); -it("display_none_with_child", function () { - var config = Yoga.Config.create(); +test("display_none_with_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setFlexGrow(1); root_child1_child0.setFlexShrink(1); root_child1_child0.setFlexBasis("0%"); root_child1_child0.setWidth(20); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(0 === root_child1_child0.getComputedWidth(), "0 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(0); + expect(root_child1_child0.getComputedHeight()).toBe(0); - console.assert(50 === root_child2.getComputedLeft(), "50 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(50); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(0 === root_child1_child0.getComputedWidth(), "0 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(0); + expect(root_child1_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -282,57 +282,57 @@ it("display_none_with_child", function () { config.free(); } }); -it("display_none_with_position", function () { - var config = Yoga.Config.create(); +test("display_none_with_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setPosition(Yoga.EDGE_TOP, 10); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -341,15 +341,15 @@ it("display_none_with_position", function () { config.free(); } }); -it("display_none_with_position_absolute", function () { - var config = Yoga.Config.create(); +test("display_none_with_position_absolute", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setWidth(100); root_child0.setHeight(100); @@ -357,27 +357,27 @@ it("display_none_with_position_absolute", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index f45f3ebf..291363d4 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -7,67 +7,67 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -it("flex_direction_column_no_height", function () { - var config = Yoga.Config.create(); +test("flex_direction_column_no_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(30); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(30); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -76,68 +76,68 @@ it("flex_direction_column_no_height", function () { config.free(); } }); -it("flex_direction_row_no_width", function () { - var config = Yoga.Config.create(); +test("flex_direction_row_no_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(30); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(10); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(30); + expect(root.getComputedHeight()).toBe(100); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(10); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -146,68 +146,68 @@ it("flex_direction_row_no_width", function () { config.free(); } }); -it("flex_direction_column", function () { - var config = Yoga.Config.create(); +test("flex_direction_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -216,69 +216,69 @@ it("flex_direction_column", function () { config.free(); } }); -it("flex_direction_row", function () { - var config = Yoga.Config.create(); +test("flex_direction_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(10); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(80 === root_child1.getComputedLeft(), "80 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(80); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(70 === root_child2.getComputedLeft(), "70 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(70); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -287,69 +287,69 @@ it("flex_direction_row", function () { config.free(); } }); -it("flex_direction_column_reverse", function () { - var config = Yoga.Config.create(); +test("flex_direction_column_reverse", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(90 === root_child0.getComputedTop(), "90 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(90); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(80); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(70); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(90 === root_child0.getComputedTop(), "90 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(90); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(80); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(70); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -358,69 +358,69 @@ it("flex_direction_column_reverse", function () { config.free(); } }); -it("flex_direction_row_reverse", function () { - var config = Yoga.Config.create(); +test("flex_direction_row_reverse", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(80 === root_child1.getComputedLeft(), "80 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(80); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(70 === root_child2.getComputedLeft(), "70 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(70); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(10); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index 8898db29..c3368ee1 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -7,55 +7,55 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -it("flex_basis_flex_grow_column", function () { - var config = Yoga.Config.create(); +test("flex_basis_flex_grow_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(75); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(75); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -64,59 +64,59 @@ it("flex_basis_flex_grow_column", function () { config.free(); } }); -it("flex_shrink_flex_grow_row", function () { - var config = Yoga.Config.create(); +test("flex_shrink_flex_grow_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexShrink(1); root_child0.setWidth(500); root_child0.setHeight(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexShrink(1); root_child1.setWidth(500); root_child1.setHeight(100); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(250); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(250); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(250); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(250); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(250); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(250); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -125,22 +125,22 @@ it("flex_shrink_flex_grow_row", function () { config.free(); } }); -it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { - var config = Yoga.Config.create(); +test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexShrink(1); root_child0.setWidth(500); root_child0.setHeight(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setWidth(500); @@ -148,37 +148,37 @@ it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(250); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(250); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(250); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(250 === root_child0.getComputedWidth(), "250 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(250); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(250); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(250 === root_child1.getComputedWidth(), "250 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(250); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -187,56 +187,56 @@ it("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { config.free(); } }); -it("flex_basis_flex_grow_row", function () { - var config = Yoga.Config.create(); +test("flex_basis_flex_grow_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(75 === root_child0.getComputedWidth(), "75 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(75); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(25); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(25 === root_child0.getComputedLeft(), "25 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(75 === root_child0.getComputedWidth(), "75 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(25); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(75); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(25); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -245,55 +245,55 @@ it("flex_basis_flex_grow_row", function () { config.free(); } }); -it("flex_basis_flex_shrink_column", function () { - var config = Yoga.Config.create(); +test("flex_basis_flex_shrink_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexShrink(1); root_child0.setFlexBasis(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -302,56 +302,56 @@ it("flex_basis_flex_shrink_column", function () { config.free(); } }); -it("flex_basis_flex_shrink_row", function () { - var config = Yoga.Config.create(); +test("flex_basis_flex_shrink_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexShrink(1); root_child0.setFlexBasis(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -360,71 +360,71 @@ it("flex_basis_flex_shrink_row", function () { config.free(); } }); -it("flex_shrink_to_zero", function () { - var config = Yoga.Config.create(); +test("flex_shrink_to_zero", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setHeight(75); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexShrink(1); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(75 === root.getComputedHeight(), "75 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(75); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(75 === root.getComputedHeight(), "75 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(75); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -433,72 +433,72 @@ it("flex_shrink_to_zero", function () { config.free(); } }); -it("flex_basis_overrides_main_size", function () { - var config = Yoga.Config.create(); +test("flex_basis_overrides_main_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -507,54 +507,54 @@ it("flex_basis_overrides_main_size", function () { config.free(); } }); -it("flex_grow_shrink_at_most", function () { - var config = Yoga.Config.create(); +test("flex_grow_shrink_at_most", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -563,69 +563,69 @@ it("flex_grow_shrink_at_most", function () { config.free(); } }); -it("flex_grow_less_than_factor_one", function () { - var config = Yoga.Config.create(); +test("flex_grow_less_than_factor_one", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(0.2); root_child0.setFlexBasis(40); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(0.2); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(0.4); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(132 === root_child0.getComputedHeight(), "132 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(132); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(132 === root_child1.getComputedTop(), "132 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(92 === root_child1.getComputedHeight(), "92 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(132); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(92); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(224 === root_child2.getComputedTop(), "224 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(200 === root_child2.getComputedWidth(), "200 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(184 === root_child2.getComputedHeight(), "184 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(224); + expect(root_child2.getComputedWidth()).toBe(200); + expect(root_child2.getComputedHeight()).toBe(184); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(132 === root_child0.getComputedHeight(), "132 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(132); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(132 === root_child1.getComputedTop(), "132 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(92 === root_child1.getComputedHeight(), "92 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(132); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(92); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(224 === root_child2.getComputedTop(), "224 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(200 === root_child2.getComputedWidth(), "200 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(184 === root_child2.getComputedHeight(), "184 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(224); + expect(root_child2.getComputedWidth()).toBe(200); + expect(root_child2.getComputedHeight()).toBe(184); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index bfa3f938..ba65302e 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -7,86 +7,86 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -it("wrap_column", function () { - var config = Yoga.Config.create(); +test("wrap_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(30); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(30); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(60); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(30); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(60 === root_child2.getComputedTop(), "60 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(60); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(30 === root_child3.getComputedLeft(), "30 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(30); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(60); + expect(root.getComputedHeight()).toBe(100); - console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(30); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(30); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(30 === root_child2.getComputedLeft(), "30 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(60 === root_child2.getComputedTop(), "60 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(30); + expect(root_child2.getComputedTop()).toBe(60); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -95,87 +95,87 @@ it("wrap_column", function () { config.free(); } }); -it("wrap_row", function () { - var config = Yoga.Config.create(); +test("wrap_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(30); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(30); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(60); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(30); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(60); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(30 === root_child0.getComputedHeight(), "30 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(30); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -184,88 +184,88 @@ it("wrap_row", function () { config.free(); } }); -it("wrap_row_align_items_flex_end", function () { - var config = Yoga.Config.create(); +test("wrap_row_align_items_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(60); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(60); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -274,88 +274,88 @@ it("wrap_row_align_items_flex_end", function () { config.free(); } }); -it("wrap_row_align_items_center", function () { - var config = Yoga.Config.create(); +test("wrap_row_align_items_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(60); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(5); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(60 === root.getComputedHeight(), "60 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(60); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(5 === root_child1.getComputedTop(), "5 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(5); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(30); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(30); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -364,59 +364,59 @@ it("wrap_row_align_items_center", function () { config.free(); } }); -it("flex_wrap_children_with_min_main_overriding_flex_basis", function () { - var config = Yoga.Config.create(); +test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexBasis(50); root_child0.setMinWidth(55); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root_child1.setMinWidth(55); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(55 === root_child0.getComputedWidth(), "55 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(55); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(55 === root_child1.getComputedWidth(), "55 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(55); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(45 === root_child0.getComputedLeft(), "45 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(55 === root_child0.getComputedWidth(), "55 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(45); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(55); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(45 === root_child1.getComputedLeft(), "45 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(55 === root_child1.getComputedWidth(), "55 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(45); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(55); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -425,84 +425,84 @@ it("flex_wrap_children_with_min_main_overriding_flex_basis", function () { config.free(); } }); -it("flex_wrap_wrap_to_child_height", function () { - var config = Yoga.Config.create(); +test("flex_wrap_wrap_to_child_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setFlexWrap(Yoga.WRAP_WRAP); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(100); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setWidth(100); root_child0_child0_child0.setHeight(100); root_child0_child0.insertChild(root_child0_child0_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(100); root_child1.setHeight(100); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedWidth(), "100 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(100); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedWidth(), "100 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(100); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -511,56 +511,56 @@ it("flex_wrap_wrap_to_child_height", function () { config.free(); } }); -it("flex_wrap_align_stretch_fits_one_row", function () { - var config = Yoga.Config.create(); +test("flex_wrap_align_stretch_fits_one_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(150 === root.getComputedWidth(), "150 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(150); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -569,102 +569,102 @@ it("flex_wrap_align_stretch_fits_one_row", function () { config.free(); } }); -it("wrap_reverse_row_align_content_flex_start", function () { - var config = Yoga.Config.create(); +test("wrap_reverse_row_align_content_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(40); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(40); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -673,103 +673,103 @@ it("wrap_reverse_row_align_content_flex_start", function () { config.free(); } }); -it("wrap_reverse_row_align_content_center", function () { - var config = Yoga.Config.create(); +test("wrap_reverse_row_align_content_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(40); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(40); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -778,102 +778,102 @@ it("wrap_reverse_row_align_content_center", function () { config.free(); } }); -it("wrap_reverse_row_single_line_different_size", function () { - var config = Yoga.Config.create(); +test("wrap_reverse_row_single_line_different_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(300); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(40); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(300); + expect(root.getComputedHeight()).toBe(50); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(40 === root_child0.getComputedTop(), "40 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(40); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(90 === root_child3.getComputedLeft(), "90 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(90); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(120 === root_child4.getComputedLeft(), "120 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(120); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(300); + expect(root.getComputedHeight()).toBe(50); - console.assert(270 === root_child0.getComputedLeft(), "270 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(40 === root_child0.getComputedTop(), "40 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(270); + expect(root_child0.getComputedTop()).toBe(40); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(240 === root_child1.getComputedLeft(), "240 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(240); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(210 === root_child2.getComputedLeft(), "210 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(210); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(180 === root_child3.getComputedLeft(), "180 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(180); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(150 === root_child4.getComputedLeft(), "150 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(150); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -882,103 +882,103 @@ it("wrap_reverse_row_single_line_different_size", function () { config.free(); } }); -it("wrap_reverse_row_align_content_stretch", function () { - var config = Yoga.Config.create(); +test("wrap_reverse_row_align_content_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(40); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(40); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -987,103 +987,103 @@ it("wrap_reverse_row_align_content_stretch", function () { config.free(); } }); -it("wrap_reverse_row_align_content_space_around", function () { - var config = Yoga.Config.create(); +test("wrap_reverse_row_align_content_space_around", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(40); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(80); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(70 === root_child0.getComputedTop(), "70 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(70); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(60 === root_child1.getComputedTop(), "60 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(50); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(70 === root_child3.getComputedLeft(), "70 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(10 === root_child3.getComputedTop(), "10 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(70); + expect(root_child3.getComputedTop()).toBe(10); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(40 === root_child4.getComputedLeft(), "40 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(40); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1092,103 +1092,103 @@ it("wrap_reverse_row_align_content_space_around", function () { config.free(); } }); -it("wrap_reverse_column_fixed_size", function () { - var config = Yoga.Config.create(); +test("wrap_reverse_column_fixed_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(30); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(30); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root_child2.setHeight(30); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(30); root_child3.setHeight(40); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(170 === root_child0.getComputedLeft(), "170 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(170); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(170 === root_child1.getComputedLeft(), "170 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(170); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(170 === root_child2.getComputedLeft(), "170 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(30 === root_child2.getComputedTop(), "30 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(170); + expect(root_child2.getComputedTop()).toBe(30); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(170 === root_child3.getComputedLeft(), "170 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(170); + expect(root_child3.getComputedTop()).toBe(60); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(140 === root_child4.getComputedLeft(), "140 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(140); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(30 === root_child0.getComputedWidth(), "30 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(30); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(30 === root_child1.getComputedWidth(), "30 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(30); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(30 === root_child2.getComputedTop(), "30 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(30 === root_child2.getComputedWidth(), "30 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(30 === root_child2.getComputedHeight(), "30 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(30); + expect(root_child2.getComputedWidth()).toBe(30); + expect(root_child2.getComputedHeight()).toBe(30); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(40 === root_child3.getComputedHeight(), "40 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(60); + expect(root_child3.getComputedWidth()).toBe(30); + expect(root_child3.getComputedHeight()).toBe(40); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(30 === root_child4.getComputedWidth(), "30 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(50 === root_child4.getComputedHeight(), "50 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(30); + expect(root_child4.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1197,72 +1197,72 @@ it("wrap_reverse_column_fixed_size", function () { config.free(); } }); -it("wrapped_row_within_align_items_center", function () { - var config = Yoga.Config.create(); +test("wrapped_row_within_align_items_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setFlexWrap(Yoga.WRAP_WRAP); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(150); root_child0_child0.setHeight(80); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(160); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(150); + expect(root_child0_child0.getComputedHeight()).toBe(80); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(80); + expect(root_child0_child1.getComputedWidth()).toBe(80); + expect(root_child0_child1.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(160); - console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(50); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(150); + expect(root_child0_child0.getComputedHeight()).toBe(80); - console.assert(120 === root_child0_child1.getComputedLeft(), "120 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(120); + expect(root_child0_child1.getComputedTop()).toBe(80); + expect(root_child0_child1.getComputedWidth()).toBe(80); + expect(root_child0_child1.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1271,72 +1271,72 @@ it("wrapped_row_within_align_items_center", function () { config.free(); } }); -it("wrapped_row_within_align_items_flex_start", function () { - var config = Yoga.Config.create(); +test("wrapped_row_within_align_items_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setFlexWrap(Yoga.WRAP_WRAP); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(150); root_child0_child0.setHeight(80); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(160); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(150); + expect(root_child0_child0.getComputedHeight()).toBe(80); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(80); + expect(root_child0_child1.getComputedWidth()).toBe(80); + expect(root_child0_child1.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(160); - console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(50); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(150); + expect(root_child0_child0.getComputedHeight()).toBe(80); - console.assert(120 === root_child0_child1.getComputedLeft(), "120 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(120); + expect(root_child0_child1.getComputedTop()).toBe(80); + expect(root_child0_child1.getComputedWidth()).toBe(80); + expect(root_child0_child1.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1345,72 +1345,72 @@ it("wrapped_row_within_align_items_flex_start", function () { config.free(); } }); -it("wrapped_row_within_align_items_flex_end", function () { - var config = Yoga.Config.create(); +test("wrapped_row_within_align_items_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setFlexWrap(Yoga.WRAP_WRAP); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(150); root_child0_child0.setHeight(80); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(160); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(150); + expect(root_child0_child0.getComputedHeight()).toBe(80); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(80); + expect(root_child0_child1.getComputedWidth()).toBe(80); + expect(root_child0_child1.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(160 === root_child0.getComputedHeight(), "160 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(160); - console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(150 === root_child0_child0.getComputedWidth(), "150 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0_child0.getComputedHeight(), "80 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(50); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(150); + expect(root_child0_child0.getComputedHeight()).toBe(80); - console.assert(120 === root_child0_child1.getComputedLeft(), "120 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(80 === root_child0_child1.getComputedTop(), "80 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(80 === root_child0_child1.getComputedWidth(), "80 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(80 === root_child0_child1.getComputedHeight(), "80 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(120); + expect(root_child0_child1.getComputedTop()).toBe(80); + expect(root_child0_child1.getComputedWidth()).toBe(80); + expect(root_child0_child1.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1419,11 +1419,11 @@ it("wrapped_row_within_align_items_flex_end", function () { config.free(); } }); -it("wrapped_column_max_height", function () { - var config = Yoga.Config.create(); +test("wrapped_column_max_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignContent(Yoga.ALIGN_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1431,13 +1431,13 @@ it("wrapped_column_max_height", function () { root.setWidth(700); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(100); root_child0.setHeight(500); root_child0.setMaxHeight(200); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setMargin(Yoga.EDGE_LEFT, 20); root_child1.setMargin(Yoga.EDGE_TOP, 20); root_child1.setMargin(Yoga.EDGE_RIGHT, 20); @@ -1446,53 +1446,53 @@ it("wrapped_column_max_height", function () { root_child1.setHeight(200); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(100); root_child2.setHeight(100); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(700); + expect(root.getComputedHeight()).toBe(500); - console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(250); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(200 === root_child1.getComputedLeft(), "200 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(250 === root_child1.getComputedTop(), "250 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(200); + expect(root_child1.getComputedTop()).toBe(250); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(200); - console.assert(420 === root_child2.getComputedLeft(), "420 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(200 === root_child2.getComputedTop(), "200 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(420); + expect(root_child2.getComputedTop()).toBe(200); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(700); + expect(root.getComputedHeight()).toBe(500); - console.assert(350 === root_child0.getComputedLeft(), "350 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(350); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(300 === root_child1.getComputedLeft(), "300 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(250 === root_child1.getComputedTop(), "250 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(300); + expect(root_child1.getComputedTop()).toBe(250); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(200); - console.assert(180 === root_child2.getComputedLeft(), "180 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(200 === root_child2.getComputedTop(), "200 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(180); + expect(root_child2.getComputedTop()).toBe(200); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1501,11 +1501,11 @@ it("wrapped_column_max_height", function () { config.free(); } }); -it("wrapped_column_max_height_flex", function () { - var config = Yoga.Config.create(); +test("wrapped_column_max_height_flex", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignContent(Yoga.ALIGN_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1513,7 +1513,7 @@ it("wrapped_column_max_height_flex", function () { root.setWidth(700); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); @@ -1522,7 +1522,7 @@ it("wrapped_column_max_height_flex", function () { root_child0.setMaxHeight(200); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); @@ -1534,53 +1534,53 @@ it("wrapped_column_max_height_flex", function () { root_child1.setHeight(200); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(100); root_child2.setHeight(100); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(700); + expect(root.getComputedHeight()).toBe(500); - console.assert(300 === root_child0.getComputedLeft(), "300 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(180 === root_child0.getComputedHeight(), "180 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(300); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(180); - console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(180 === root_child1.getComputedHeight(), "180 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(250); + expect(root_child1.getComputedTop()).toBe(200); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(180); - console.assert(300 === root_child2.getComputedLeft(), "300 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(400 === root_child2.getComputedTop(), "400 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(300); + expect(root_child2.getComputedTop()).toBe(400); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(700 === root.getComputedWidth(), "700 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(700); + expect(root.getComputedHeight()).toBe(500); - console.assert(300 === root_child0.getComputedLeft(), "300 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(180 === root_child0.getComputedHeight(), "180 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(300); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(180); - console.assert(250 === root_child1.getComputedLeft(), "250 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(180 === root_child1.getComputedHeight(), "180 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(250); + expect(root_child1.getComputedTop()).toBe(200); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(180); - console.assert(300 === root_child2.getComputedLeft(), "300 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(400 === root_child2.getComputedTop(), "400 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(300); + expect(root_child2.getComputedTop()).toBe(400); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1589,99 +1589,99 @@ it("wrapped_column_max_height_flex", function () { config.free(); } }); -it("wrap_nodes_with_content_sizing_overflowing_margin", function () { - var config = Yoga.Config.create(); +test("wrap_nodes_with_content_sizing_overflowing_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setFlexWrap(Yoga.WRAP_WRAP); root_child0.setWidth(85); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setWidth(40); root_child0_child0_child0.setHeight(40); root_child0_child0.insertChild(root_child0_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setMargin(Yoga.EDGE_RIGHT, 10); root_child0.insertChild(root_child0_child1, 1); - var root_child0_child1_child0 = Yoga.Node.create(config); + const root_child0_child1_child0 = Yoga.Node.create(config); root_child0_child1_child0.setWidth(40); root_child0_child1_child0.setHeight(40); root_child0_child1.insertChild(root_child0_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(85 === root_child0.getComputedWidth(), "85 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(85); + expect(root_child0.getComputedHeight()).toBe(80); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(40 === root_child0_child1.getComputedTop(), "40 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(40); + expect(root_child0_child1.getComputedWidth()).toBe(40); + expect(root_child0_child1.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child1_child0.getComputedLeft()).toBe(0); + expect(root_child0_child1_child0.getComputedTop()).toBe(0); + expect(root_child0_child1_child0.getComputedWidth()).toBe(40); + expect(root_child0_child1_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(415 === root_child0.getComputedLeft(), "415 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(85 === root_child0.getComputedWidth(), "85 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(415); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(85); + expect(root_child0.getComputedHeight()).toBe(80); - console.assert(45 === root_child0_child0.getComputedLeft(), "45 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(45); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0_child0.getComputedHeight()).toBe(40); - console.assert(35 === root_child0_child1.getComputedLeft(), "35 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(40 === root_child0_child1.getComputedTop(), "40 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(35); + expect(root_child0_child1.getComputedTop()).toBe(40); + expect(root_child0_child1.getComputedWidth()).toBe(40); + expect(root_child0_child1.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child1_child0.getComputedLeft()).toBe(0); + expect(root_child0_child1_child0.getComputedTop()).toBe(0); + expect(root_child0_child1_child0.getComputedWidth()).toBe(40); + expect(root_child0_child1_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1690,99 +1690,99 @@ it("wrap_nodes_with_content_sizing_overflowing_margin", function () { config.free(); } }); -it("wrap_nodes_with_content_sizing_margin_cross", function () { - var config = Yoga.Config.create(); +test("wrap_nodes_with_content_sizing_margin_cross", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setFlexWrap(Yoga.WRAP_WRAP); root_child0.setWidth(70); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setWidth(40); root_child0_child0_child0.setHeight(40); root_child0_child0.insertChild(root_child0_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setMargin(Yoga.EDGE_TOP, 10); root_child0.insertChild(root_child0_child1, 1); - var root_child0_child1_child0 = Yoga.Node.create(config); + const root_child0_child1_child0 = Yoga.Node.create(config); root_child0_child1_child0.setWidth(40); root_child0_child1_child0.setHeight(40); root_child0_child1.insertChild(root_child0_child1_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(70 === root_child0.getComputedWidth(), "70 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(70); + expect(root_child0.getComputedHeight()).toBe(90); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(50 === root_child0_child1.getComputedTop(), "50 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(50); + expect(root_child0_child1.getComputedWidth()).toBe(40); + expect(root_child0_child1.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child1_child0.getComputedLeft()).toBe(0); + expect(root_child0_child1_child0.getComputedTop()).toBe(0); + expect(root_child0_child1_child0.getComputedWidth()).toBe(40); + expect(root_child0_child1_child0.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(430 === root_child0.getComputedLeft(), "430 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(70 === root_child0.getComputedWidth(), "70 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(430); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(70); + expect(root_child0.getComputedHeight()).toBe(90); - console.assert(30 === root_child0_child0.getComputedLeft(), "30 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0.getComputedWidth(), "40 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0.getComputedHeight(), "40 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(30); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedWidth(), "40 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child0_child0.getComputedHeight(), "40 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(40); + expect(root_child0_child0_child0.getComputedHeight()).toBe(40); - console.assert(30 === root_child0_child1.getComputedLeft(), "30 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(50 === root_child0_child1.getComputedTop(), "50 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(40 === root_child0_child1.getComputedWidth(), "40 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1.getComputedHeight(), "40 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(30); + expect(root_child0_child1.getComputedTop()).toBe(50); + expect(root_child0_child1.getComputedWidth()).toBe(40); + expect(root_child0_child1.getComputedHeight()).toBe(40); - console.assert(0 === root_child0_child1_child0.getComputedLeft(), "0 === root_child0_child1_child0.getComputedLeft() (" + root_child0_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1_child0.getComputedTop(), "0 === root_child0_child1_child0.getComputedTop() (" + root_child0_child1_child0.getComputedTop() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedWidth(), "40 === root_child0_child1_child0.getComputedWidth() (" + root_child0_child1_child0.getComputedWidth() + ")"); - console.assert(40 === root_child0_child1_child0.getComputedHeight(), "40 === root_child0_child1_child0.getComputedHeight() (" + root_child0_child1_child0.getComputedHeight() + ")"); + expect(root_child0_child1_child0.getComputedLeft()).toBe(0); + expect(root_child0_child1_child0.getComputedTop()).toBe(0); + expect(root_child0_child1_child0.getComputedWidth()).toBe(40); + expect(root_child0_child1_child0.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index c178f66a..242e317f 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -7,77 +7,77 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -it("column_gap_flexible", function () { - var config = Yoga.Config.create(); +test("column_gap_flexible", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -86,70 +86,70 @@ it("column_gap_flexible", function () { config.free(); } }); -it("column_gap_inflexible", function () { - var config = Yoga.Config.create(); +test("column_gap_inflexible", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -158,72 +158,72 @@ it("column_gap_inflexible", function () { config.free(); } }); -it("column_gap_mixed_flexible", function () { - var config = Yoga.Config.create(); +test("column_gap_mixed_flexible", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -232,17 +232,17 @@ it("column_gap_mixed_flexible", function () { config.free(); } }); -it("column_gap_child_margins", function () { - var config = Yoga.Config.create(); +test("column_gap_child_margins", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); @@ -250,7 +250,7 @@ it("column_gap_child_margins", function () { root_child0.setMargin(Yoga.EDGE_RIGHT, 2); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); @@ -258,7 +258,7 @@ it("column_gap_child_margins", function () { root_child1.setMargin(Yoga.EDGE_RIGHT, 10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); @@ -267,47 +267,47 @@ it("column_gap_child_margins", function () { root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(2 === root_child0.getComputedLeft(), "2 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(2 === root_child0.getComputedWidth(), "2 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(2); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(2); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(26 === root_child1.getComputedLeft(), "26 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(2 === root_child1.getComputedWidth(), "2 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(26); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(2); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(63 === root_child2.getComputedLeft(), "63 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(2 === root_child2.getComputedWidth(), "2 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(63); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(2); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(76 === root_child0.getComputedLeft(), "76 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(2 === root_child0.getComputedWidth(), "2 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(76); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(2); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(52 === root_child1.getComputedLeft(), "52 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(2 === root_child1.getComputedWidth(), "2 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(52); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(2); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(15 === root_child2.getComputedLeft(), "15 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(2 === root_child2.getComputedWidth(), "2 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(15); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(2); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -316,164 +316,164 @@ it("column_gap_child_margins", function () { config.free(); } }); -it("column_row_gap_wrapping", function () { - var config = Yoga.Config.create(); +test("column_row_gap_wrapping", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(80); root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root_child3.setHeight(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root_child4.setHeight(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - var root_child6 = Yoga.Node.create(config); + const root_child6 = Yoga.Node.create(config); root_child6.setWidth(20); root_child6.setHeight(20); root.insertChild(root_child6, 6); - var root_child7 = Yoga.Node.create(config); + const root_child7 = Yoga.Node.create(config); root_child7.setWidth(20); root_child7.setHeight(20); root.insertChild(root_child7, 7); - var root_child8 = Yoga.Node.create(config); + const root_child8 = Yoga.Node.create(config); root_child8.setWidth(20); root_child8.setHeight(20); root.insertChild(root_child8, 8); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(40); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(40); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(40); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); - console.assert(0 === root_child6.getComputedLeft(), "0 === root_child6.getComputedLeft() (" + root_child6.getComputedLeft() + ")"); - console.assert(80 === root_child6.getComputedTop(), "80 === root_child6.getComputedTop() (" + root_child6.getComputedTop() + ")"); - console.assert(20 === root_child6.getComputedWidth(), "20 === root_child6.getComputedWidth() (" + root_child6.getComputedWidth() + ")"); - console.assert(20 === root_child6.getComputedHeight(), "20 === root_child6.getComputedHeight() (" + root_child6.getComputedHeight() + ")"); + expect(root_child6.getComputedLeft()).toBe(0); + expect(root_child6.getComputedTop()).toBe(80); + expect(root_child6.getComputedWidth()).toBe(20); + expect(root_child6.getComputedHeight()).toBe(20); - console.assert(30 === root_child7.getComputedLeft(), "30 === root_child7.getComputedLeft() (" + root_child7.getComputedLeft() + ")"); - console.assert(80 === root_child7.getComputedTop(), "80 === root_child7.getComputedTop() (" + root_child7.getComputedTop() + ")"); - console.assert(20 === root_child7.getComputedWidth(), "20 === root_child7.getComputedWidth() (" + root_child7.getComputedWidth() + ")"); - console.assert(20 === root_child7.getComputedHeight(), "20 === root_child7.getComputedHeight() (" + root_child7.getComputedHeight() + ")"); + expect(root_child7.getComputedLeft()).toBe(30); + expect(root_child7.getComputedTop()).toBe(80); + expect(root_child7.getComputedWidth()).toBe(20); + expect(root_child7.getComputedHeight()).toBe(20); - console.assert(60 === root_child8.getComputedLeft(), "60 === root_child8.getComputedLeft() (" + root_child8.getComputedLeft() + ")"); - console.assert(80 === root_child8.getComputedTop(), "80 === root_child8.getComputedTop() (" + root_child8.getComputedTop() + ")"); - console.assert(20 === root_child8.getComputedWidth(), "20 === root_child8.getComputedWidth() (" + root_child8.getComputedWidth() + ")"); - console.assert(20 === root_child8.getComputedHeight(), "20 === root_child8.getComputedHeight() (" + root_child8.getComputedHeight() + ")"); + expect(root_child8.getComputedLeft()).toBe(60); + expect(root_child8.getComputedTop()).toBe(80); + expect(root_child8.getComputedWidth()).toBe(20); + expect(root_child8.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(60 === root_child3.getComputedLeft(), "60 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(60); + expect(root_child3.getComputedTop()).toBe(40); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(40); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(0 === root_child5.getComputedLeft(), "0 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(0); + expect(root_child5.getComputedTop()).toBe(40); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); - console.assert(60 === root_child6.getComputedLeft(), "60 === root_child6.getComputedLeft() (" + root_child6.getComputedLeft() + ")"); - console.assert(80 === root_child6.getComputedTop(), "80 === root_child6.getComputedTop() (" + root_child6.getComputedTop() + ")"); - console.assert(20 === root_child6.getComputedWidth(), "20 === root_child6.getComputedWidth() (" + root_child6.getComputedWidth() + ")"); - console.assert(20 === root_child6.getComputedHeight(), "20 === root_child6.getComputedHeight() (" + root_child6.getComputedHeight() + ")"); + expect(root_child6.getComputedLeft()).toBe(60); + expect(root_child6.getComputedTop()).toBe(80); + expect(root_child6.getComputedWidth()).toBe(20); + expect(root_child6.getComputedHeight()).toBe(20); - console.assert(30 === root_child7.getComputedLeft(), "30 === root_child7.getComputedLeft() (" + root_child7.getComputedLeft() + ")"); - console.assert(80 === root_child7.getComputedTop(), "80 === root_child7.getComputedTop() (" + root_child7.getComputedTop() + ")"); - console.assert(20 === root_child7.getComputedWidth(), "20 === root_child7.getComputedWidth() (" + root_child7.getComputedWidth() + ")"); - console.assert(20 === root_child7.getComputedHeight(), "20 === root_child7.getComputedHeight() (" + root_child7.getComputedHeight() + ")"); + expect(root_child7.getComputedLeft()).toBe(30); + expect(root_child7.getComputedTop()).toBe(80); + expect(root_child7.getComputedWidth()).toBe(20); + expect(root_child7.getComputedHeight()).toBe(20); - console.assert(0 === root_child8.getComputedLeft(), "0 === root_child8.getComputedLeft() (" + root_child8.getComputedLeft() + ")"); - console.assert(80 === root_child8.getComputedTop(), "80 === root_child8.getComputedTop() (" + root_child8.getComputedTop() + ")"); - console.assert(20 === root_child8.getComputedWidth(), "20 === root_child8.getComputedWidth() (" + root_child8.getComputedWidth() + ")"); - console.assert(20 === root_child8.getComputedHeight(), "20 === root_child8.getComputedHeight() (" + root_child8.getComputedHeight() + ")"); + expect(root_child8.getComputedLeft()).toBe(0); + expect(root_child8.getComputedTop()).toBe(80); + expect(root_child8.getComputedWidth()).toBe(20); + expect(root_child8.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -482,70 +482,70 @@ it("column_row_gap_wrapping", function () { config.free(); } }); -it("column_gap_justify_flex_start", function () { - var config = Yoga.Config.create(); +test("column_gap_justify_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -554,71 +554,71 @@ it("column_gap_justify_flex_start", function () { config.free(); } }); -it("column_gap_justify_center", function () { - var config = Yoga.Config.create(); +test("column_gap_justify_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(100); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(70 === root_child2.getComputedLeft(), "70 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(70); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(70 === root_child0.getComputedLeft(), "70 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(70); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(10 === root_child2.getComputedLeft(), "10 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -627,71 +627,71 @@ it("column_gap_justify_center", function () { config.free(); } }); -it("column_gap_justify_flex_end", function () { - var config = Yoga.Config.create(); +test("column_gap_justify_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(100); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(80); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -700,71 +700,71 @@ it("column_gap_justify_flex_end", function () { config.free(); } }); -it("column_gap_justify_space_between", function () { - var config = Yoga.Config.create(); +test("column_gap_justify_space_between", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); root.setWidth(100); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(80); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -773,71 +773,71 @@ it("column_gap_justify_space_between", function () { config.free(); } }); -it("column_gap_justify_space_around", function () { - var config = Yoga.Config.create(); +test("column_gap_justify_space_around", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); root.setWidth(100); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(3 === root_child0.getComputedLeft(), "3 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(3); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(77 === root_child2.getComputedLeft(), "77 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(77); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(77 === root_child0.getComputedLeft(), "77 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(77); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(3 === root_child2.getComputedLeft(), "3 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(3); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -846,71 +846,71 @@ it("column_gap_justify_space_around", function () { config.free(); } }); -it("column_gap_justify_space_evenly", function () { - var config = Yoga.Config.create(); +test("column_gap_justify_space_evenly", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); root.setWidth(100); root.setHeight(100); root.setGap(Yoga.GUTTER_COLUMN, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(75 === root_child2.getComputedLeft(), "75 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(75); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(5 === root_child2.getComputedLeft(), "5 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(5); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -919,11 +919,11 @@ it("column_gap_justify_space_evenly", function () { config.free(); } }); -it("column_gap_wrap_align_flex_start", function () { - var config = Yoga.Config.create(); +test("column_gap_wrap_align_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -931,108 +931,108 @@ it("column_gap_wrap_align_flex_start", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root_child3.setHeight(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root_child4.setHeight(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(40); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(40); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(40); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(40 === root_child3.getComputedTop(), "40 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(40); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(40); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(40 === root_child5.getComputedTop(), "40 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(40); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1041,11 +1041,11 @@ it("column_gap_wrap_align_flex_start", function () { config.free(); } }); -it("column_gap_wrap_align_center", function () { - var config = Yoga.Config.create(); +test("column_gap_wrap_align_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1054,108 +1054,108 @@ it("column_gap_wrap_align_center", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root_child3.setHeight(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root_child4.setHeight(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(20 === root_child1.getComputedTop(), "20 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(20); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(60); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(60 === root_child4.getComputedTop(), "60 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(60); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(60 === root_child5.getComputedTop(), "60 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(60); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(20 === root_child1.getComputedTop(), "20 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(20); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(60 === root_child3.getComputedTop(), "60 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(60); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(60 === root_child4.getComputedTop(), "60 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(60); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(60 === root_child5.getComputedTop(), "60 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(60); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1164,11 +1164,11 @@ it("column_gap_wrap_align_center", function () { config.free(); } }); -it("column_gap_wrap_align_flex_end", function () { - var config = Yoga.Config.create(); +test("column_gap_wrap_align_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1177,108 +1177,108 @@ it("column_gap_wrap_align_flex_end", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root_child3.setHeight(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root_child4.setHeight(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(40 === root_child0.getComputedTop(), "40 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(40); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(40); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(80); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(40 === root_child0.getComputedTop(), "40 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(40); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(40); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(40 === root_child2.getComputedTop(), "40 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(40); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(80); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1287,11 +1287,11 @@ it("column_gap_wrap_align_flex_end", function () { config.free(); } }); -it("column_gap_wrap_align_space_between", function () { - var config = Yoga.Config.create(); +test("column_gap_wrap_align_space_between", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1300,108 +1300,108 @@ it("column_gap_wrap_align_space_between", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root_child3.setHeight(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root_child4.setHeight(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(80); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(80 === root_child3.getComputedTop(), "80 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(80); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(80 === root_child4.getComputedTop(), "80 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(80); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(80 === root_child5.getComputedTop(), "80 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(80); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1410,11 +1410,11 @@ it("column_gap_wrap_align_space_between", function () { config.free(); } }); -it("column_gap_wrap_align_space_around", function () { - var config = Yoga.Config.create(); +test("column_gap_wrap_align_space_around", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1423,108 +1423,108 @@ it("column_gap_wrap_align_space_around", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root_child2.setHeight(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root_child3.setHeight(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root_child4.setHeight(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(10); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(70); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(70 === root_child4.getComputedTop(), "70 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(70); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(70 === root_child5.getComputedTop(), "70 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(70); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(20); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(10); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(20); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(70 === root_child3.getComputedTop(), "70 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(20 === root_child3.getComputedHeight(), "20 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(70); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(20); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(70 === root_child4.getComputedTop(), "70 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(20 === root_child4.getComputedHeight(), "20 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(70); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(20); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(70 === root_child5.getComputedTop(), "70 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(20 === root_child5.getComputedHeight(), "20 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(70); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1533,11 +1533,11 @@ it("column_gap_wrap_align_space_around", function () { config.free(); } }); -it("column_gap_wrap_align_stretch", function () { - var config = Yoga.Config.create(); +test("column_gap_wrap_align_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1545,93 +1545,93 @@ it("column_gap_wrap_align_stretch", function () { root.setHeight(300); root.setGap(Yoga.GUTTER_COLUMN, 5); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMinWidth(60); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setMinWidth(60); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setMinWidth(60); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setFlexGrow(1); root_child3.setMinWidth(60); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setFlexGrow(1); root_child4.setMinWidth(60); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(300); + expect(root.getComputedHeight()).toBe(300); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(71 === root_child0.getComputedWidth(), "71 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(71); + expect(root_child0.getComputedHeight()).toBe(150); - console.assert(76 === root_child1.getComputedLeft(), "76 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(72 === root_child1.getComputedWidth(), "72 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(76); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(72); + expect(root_child1.getComputedHeight()).toBe(150); - console.assert(153 === root_child2.getComputedLeft(), "153 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(71 === root_child2.getComputedWidth(), "71 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(150 === root_child2.getComputedHeight(), "150 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(153); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(71); + expect(root_child2.getComputedHeight()).toBe(150); - console.assert(229 === root_child3.getComputedLeft(), "229 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(71 === root_child3.getComputedWidth(), "71 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(150 === root_child3.getComputedHeight(), "150 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(229); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(71); + expect(root_child3.getComputedHeight()).toBe(150); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(150 === root_child4.getComputedTop(), "150 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(300 === root_child4.getComputedWidth(), "300 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(150 === root_child4.getComputedHeight(), "150 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(150); + expect(root_child4.getComputedWidth()).toBe(300); + expect(root_child4.getComputedHeight()).toBe(150); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(300 === root.getComputedWidth(), "300 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(300); + expect(root.getComputedHeight()).toBe(300); - console.assert(229 === root_child0.getComputedLeft(), "229 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(71 === root_child0.getComputedWidth(), "71 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(229); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(71); + expect(root_child0.getComputedHeight()).toBe(150); - console.assert(153 === root_child1.getComputedLeft(), "153 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(71 === root_child1.getComputedWidth(), "71 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(153); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(71); + expect(root_child1.getComputedHeight()).toBe(150); - console.assert(76 === root_child2.getComputedLeft(), "76 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(72 === root_child2.getComputedWidth(), "72 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(150 === root_child2.getComputedHeight(), "150 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(76); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(72); + expect(root_child2.getComputedHeight()).toBe(150); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(71 === root_child3.getComputedWidth(), "71 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(150 === root_child3.getComputedHeight(), "150 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(71); + expect(root_child3.getComputedHeight()).toBe(150); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(150 === root_child4.getComputedTop(), "150 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(300 === root_child4.getComputedWidth(), "300 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(150 === root_child4.getComputedHeight(), "150 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(150); + expect(root_child4.getComputedWidth()).toBe(300); + expect(root_child4.getComputedHeight()).toBe(150); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1640,11 +1640,11 @@ it("column_gap_wrap_align_stretch", function () { config.free(); } }); -it("row_gap_align_items_stretch", function () { - var config = Yoga.Config.create(); +test("row_gap_align_items_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1653,102 +1653,102 @@ it("row_gap_align_items_stretch", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(90); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(90 === root_child1.getComputedHeight(), "90 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(90); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(90); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(110 === root_child3.getComputedTop(), "110 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(90 === root_child3.getComputedHeight(), "90 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(110); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(90); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(110 === root_child4.getComputedTop(), "110 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(90 === root_child4.getComputedHeight(), "90 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(110); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(90); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(110 === root_child5.getComputedTop(), "110 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(90 === root_child5.getComputedHeight(), "90 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(110); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(90); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(90); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(90 === root_child1.getComputedHeight(), "90 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(90); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(90 === root_child2.getComputedHeight(), "90 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(90); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(110 === root_child3.getComputedTop(), "110 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(90 === root_child3.getComputedHeight(), "90 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(110); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(90); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(110 === root_child4.getComputedTop(), "110 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(90 === root_child4.getComputedHeight(), "90 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(110); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(90); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(110 === root_child5.getComputedTop(), "110 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(90 === root_child5.getComputedHeight(), "90 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(110); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(90); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1757,11 +1757,11 @@ it("row_gap_align_items_stretch", function () { config.free(); } }); -it("row_gap_align_items_end", function () { - var config = Yoga.Config.create(); +test("row_gap_align_items_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1770,102 +1770,102 @@ it("row_gap_align_items_end", function () { root.setGap(Yoga.GUTTER_COLUMN, 10); root.setGap(Yoga.GUTTER_ROW, 20); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setWidth(20); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setWidth(20); root.insertChild(root_child4, 4); - var root_child5 = Yoga.Node.create(config); + const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root.insertChild(root_child5, 5); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(30 === root_child1.getComputedLeft(), "30 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(30); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(60 === root_child2.getComputedLeft(), "60 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(60); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(0 === root_child3.getComputedLeft(), "0 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(20 === root_child3.getComputedTop(), "20 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(0); + expect(root_child3.getComputedTop()).toBe(20); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(0); - console.assert(30 === root_child4.getComputedLeft(), "30 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(30); + expect(root_child4.getComputedTop()).toBe(20); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(0); - console.assert(60 === root_child5.getComputedLeft(), "60 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(20 === root_child5.getComputedTop(), "20 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(0 === root_child5.getComputedHeight(), "0 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(60); + expect(root_child5.getComputedTop()).toBe(20); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(20 === root_child2.getComputedWidth(), "20 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(20); + expect(root_child2.getComputedHeight()).toBe(0); - console.assert(80 === root_child3.getComputedLeft(), "80 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(20 === root_child3.getComputedTop(), "20 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(20 === root_child3.getComputedWidth(), "20 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(0 === root_child3.getComputedHeight(), "0 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(80); + expect(root_child3.getComputedTop()).toBe(20); + expect(root_child3.getComputedWidth()).toBe(20); + expect(root_child3.getComputedHeight()).toBe(0); - console.assert(50 === root_child4.getComputedLeft(), "50 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(20 === root_child4.getComputedTop(), "20 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(20 === root_child4.getComputedWidth(), "20 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(50); + expect(root_child4.getComputedTop()).toBe(20); + expect(root_child4.getComputedWidth()).toBe(20); + expect(root_child4.getComputedHeight()).toBe(0); - console.assert(20 === root_child5.getComputedLeft(), "20 === root_child5.getComputedLeft() (" + root_child5.getComputedLeft() + ")"); - console.assert(20 === root_child5.getComputedTop(), "20 === root_child5.getComputedTop() (" + root_child5.getComputedTop() + ")"); - console.assert(20 === root_child5.getComputedWidth(), "20 === root_child5.getComputedWidth() (" + root_child5.getComputedWidth() + ")"); - console.assert(0 === root_child5.getComputedHeight(), "0 === root_child5.getComputedHeight() (" + root_child5.getComputedHeight() + ")"); + expect(root_child5.getComputedLeft()).toBe(20); + expect(root_child5.getComputedTop()).toBe(20); + expect(root_child5.getComputedWidth()).toBe(20); + expect(root_child5.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1874,16 +1874,16 @@ it("row_gap_align_items_end", function () { config.free(); } }); -it("row_gap_column_child_margins", function () { - var config = Yoga.Config.create(); +test("row_gap_column_child_margins", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(200); root.setGap(Yoga.GUTTER_ROW, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); @@ -1891,7 +1891,7 @@ it("row_gap_column_child_margins", function () { root_child0.setMargin(Yoga.EDGE_BOTTOM, 2); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); @@ -1899,7 +1899,7 @@ it("row_gap_column_child_margins", function () { root_child1.setMargin(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); @@ -1908,47 +1908,47 @@ it("row_gap_column_child_margins", function () { root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(42 === root_child0.getComputedHeight(), "42 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(2); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(42); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(66 === root_child1.getComputedTop(), "66 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(42 === root_child1.getComputedHeight(), "42 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(66); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(42); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(143 === root_child2.getComputedTop(), "143 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(42 === root_child2.getComputedHeight(), "42 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(143); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(42); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(42 === root_child0.getComputedHeight(), "42 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(2); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(42); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(66 === root_child1.getComputedTop(), "66 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(42 === root_child1.getComputedHeight(), "42 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(66); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(42); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(143 === root_child2.getComputedTop(), "143 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(42 === root_child2.getComputedHeight(), "42 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(143); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(42); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1957,77 +1957,77 @@ it("row_gap_column_child_margins", function () { config.free(); } }); -it("row_gap_row_wrap_child_margins", function () { - var config = Yoga.Config.create(); +test("row_gap_row_wrap_child_margins", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(200); root.setGap(Yoga.GUTTER_ROW, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, 2); root_child0.setMargin(Yoga.EDGE_BOTTOM, 2); root_child0.setWidth(60); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setMargin(Yoga.EDGE_TOP, 10); root_child1.setMargin(Yoga.EDGE_BOTTOM, 10); root_child1.setWidth(60); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setMargin(Yoga.EDGE_TOP, 15); root_child2.setMargin(Yoga.EDGE_BOTTOM, 15); root_child2.setWidth(60); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(2); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(24 === root_child1.getComputedTop(), "24 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(60 === root_child1.getComputedWidth(), "60 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(24); + expect(root_child1.getComputedWidth()).toBe(60); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(59 === root_child2.getComputedTop(), "59 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(60 === root_child2.getComputedWidth(), "60 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(59); + expect(root_child2.getComputedWidth()).toBe(60); + expect(root_child2.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(200); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(2 === root_child0.getComputedTop(), "2 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(2); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(24 === root_child1.getComputedTop(), "24 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(60 === root_child1.getComputedWidth(), "60 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(0 === root_child1.getComputedHeight(), "0 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(24); + expect(root_child1.getComputedWidth()).toBe(60); + expect(root_child1.getComputedHeight()).toBe(0); - console.assert(40 === root_child2.getComputedLeft(), "40 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(59 === root_child2.getComputedTop(), "59 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(60 === root_child2.getComputedWidth(), "60 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(0 === root_child2.getComputedHeight(), "0 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(40); + expect(root_child2.getComputedTop()).toBe(59); + expect(root_child2.getComputedWidth()).toBe(60); + expect(root_child2.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index 89cc28a2..bb2c9721 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -7,69 +7,69 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -it("justify_content_row_flex_start", function () { - var config = Yoga.Config.create(); +test("justify_content_row_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(10); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(20 === root_child2.getComputedLeft(), "20 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(20); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(92 === root_child0.getComputedLeft(), "92 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(92); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(82 === root_child1.getComputedLeft(), "82 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(82); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(72 === root_child2.getComputedLeft(), "72 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(72); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -78,70 +78,70 @@ it("justify_content_row_flex_start", function () { config.free(); } }); -it("justify_content_row_flex_end", function () { - var config = Yoga.Config.create(); +test("justify_content_row_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(72 === root_child0.getComputedLeft(), "72 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(72); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(82 === root_child1.getComputedLeft(), "82 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(82); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(92 === root_child2.getComputedLeft(), "92 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(92); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(10 === root_child1.getComputedLeft(), "10 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(10); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -150,70 +150,70 @@ it("justify_content_row_flex_end", function () { config.free(); } }); -it("justify_content_row_center", function () { - var config = Yoga.Config.create(); +test("justify_content_row_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(36 === root_child0.getComputedLeft(), "36 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(36); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(46); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(56 === root_child2.getComputedLeft(), "56 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(56); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(56 === root_child0.getComputedLeft(), "56 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(56); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(46); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(36 === root_child2.getComputedLeft(), "36 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(36); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -222,70 +222,70 @@ it("justify_content_row_center", function () { config.free(); } }); -it("justify_content_row_space_between", function () { - var config = Yoga.Config.create(); +test("justify_content_row_space_between", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(46); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(92 === root_child2.getComputedLeft(), "92 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(92); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(92 === root_child0.getComputedLeft(), "92 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(92); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(46); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -294,70 +294,70 @@ it("justify_content_row_space_between", function () { config.free(); } }); -it("justify_content_row_space_around", function () { - var config = Yoga.Config.create(); +test("justify_content_row_space_around", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(12 === root_child0.getComputedLeft(), "12 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(12); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(46); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(80 === root_child2.getComputedLeft(), "80 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(80); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(102 === root_child0.getComputedHeight(), "102 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(102); - console.assert(46 === root_child1.getComputedLeft(), "46 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(102 === root_child1.getComputedHeight(), "102 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(46); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(102); - console.assert(12 === root_child2.getComputedLeft(), "12 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(12); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(102); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -366,68 +366,68 @@ it("justify_content_row_space_around", function () { config.free(); } }); -it("justify_content_column_flex_start", function () { - var config = Yoga.Config.create(); +test("justify_content_column_flex_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(10 === root_child1.getComputedTop(), "10 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(10); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(20); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -436,69 +436,69 @@ it("justify_content_column_flex_start", function () { config.free(); } }); -it("justify_content_column_flex_end", function () { - var config = Yoga.Config.create(); +test("justify_content_column_flex_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(72 === root_child0.getComputedTop(), "72 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(72); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(82 === root_child1.getComputedTop(), "82 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(82); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(92); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(72 === root_child0.getComputedTop(), "72 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(72); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(82 === root_child1.getComputedTop(), "82 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(82); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(92); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -507,69 +507,69 @@ it("justify_content_column_flex_end", function () { config.free(); } }); -it("justify_content_column_center", function () { - var config = Yoga.Config.create(); +test("justify_content_column_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(36 === root_child0.getComputedTop(), "36 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(36); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(56 === root_child2.getComputedTop(), "56 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(56); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(36 === root_child0.getComputedTop(), "36 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(36); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(56 === root_child2.getComputedTop(), "56 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(56); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -578,69 +578,69 @@ it("justify_content_column_center", function () { config.free(); } }); -it("justify_content_column_space_between", function () { - var config = Yoga.Config.create(); +test("justify_content_column_space_between", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(92); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(92); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -649,69 +649,69 @@ it("justify_content_column_space_between", function () { config.free(); } }); -it("justify_content_column_space_around", function () { - var config = Yoga.Config.create(); +test("justify_content_column_space_around", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(12 === root_child0.getComputedTop(), "12 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(12); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(12 === root_child0.getComputedTop(), "12 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(12); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -720,43 +720,43 @@ it("justify_content_column_space_around", function () { config.free(); } }); -it("justify_content_row_min_width_and_margin", function () { - var config = Yoga.Config.create(); +test("justify_content_row_min_width_and_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_LEFT, 100); root.setMinWidth(50); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(100); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(20); - console.assert(15 === root_child0.getComputedLeft(), "15 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(15); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(100); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(20); - console.assert(15 === root_child0.getComputedLeft(), "15 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(15); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -765,44 +765,44 @@ it("justify_content_row_min_width_and_margin", function () { config.free(); } }); -it("justify_content_row_max_width_and_margin", function () { - var config = Yoga.Config.create(); +test("justify_content_row_max_width_and_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_LEFT, 100); root.setWidth(100); root.setMaxWidth(80); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(100); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(20); - console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(30); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(100 === root.getComputedLeft(), "100 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(80 === root.getComputedWidth(), "80 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(100); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(80); + expect(root.getComputedHeight()).toBe(20); - console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(30); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -811,42 +811,42 @@ it("justify_content_row_max_width_and_margin", function () { config.free(); } }); -it("justify_content_column_min_height_and_margin", function () { - var config = Yoga.Config.create(); +test("justify_content_column_min_height_and_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_TOP, 100); root.setMinHeight(50); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(100); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(50); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(15); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(100); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(50); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(15 === root_child0.getComputedTop(), "15 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(15); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -855,43 +855,43 @@ it("justify_content_column_min_height_and_margin", function () { config.free(); } }); -it("justify_content_colunn_max_height_and_margin", function () { - var config = Yoga.Config.create(); +test("justify_content_colunn_max_height_and_margin", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_TOP, 100); root.setHeight(100); root.setMaxHeight(80); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(100); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(80); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(100 === root.getComputedTop(), "100 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(80 === root.getComputedHeight(), "80 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(100); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(80); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(30 === root_child0.getComputedTop(), "30 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(20 === root_child0.getComputedWidth(), "20 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(30); + expect(root_child0.getComputedWidth()).toBe(20); + expect(root_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -900,69 +900,69 @@ it("justify_content_colunn_max_height_and_margin", function () { config.free(); } }); -it("justify_content_column_space_evenly", function () { - var config = Yoga.Config.create(); +test("justify_content_column_space_evenly", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(18 === root_child0.getComputedTop(), "18 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(18); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(74 === root_child2.getComputedTop(), "74 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(74); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(18 === root_child0.getComputedTop(), "18 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(102 === root_child0.getComputedWidth(), "102 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(18); + expect(root_child0.getComputedWidth()).toBe(102); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(46 === root_child1.getComputedTop(), "46 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(102 === root_child1.getComputedWidth(), "102 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(46); + expect(root_child1.getComputedWidth()).toBe(102); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(74 === root_child2.getComputedTop(), "74 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(74); + expect(root_child2.getComputedWidth()).toBe(102); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -971,70 +971,70 @@ it("justify_content_column_space_evenly", function () { config.free(); } }); -it("justify_content_row_space_evenly", function () { - var config = Yoga.Config.create(); +test("justify_content_row_space_evenly", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); root.setWidth(102); root.setHeight(102); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(26 === root_child0.getComputedLeft(), "26 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(26); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(51 === root_child1.getComputedLeft(), "51 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(51); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(77 === root_child2.getComputedLeft(), "77 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(0 === root_child2.getComputedWidth(), "0 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(77); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(0); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(102 === root.getComputedWidth(), "102 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(102 === root.getComputedHeight(), "102 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(102); + expect(root.getComputedHeight()).toBe(102); - console.assert(77 === root_child0.getComputedLeft(), "77 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(77); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(51 === root_child1.getComputedLeft(), "51 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(51); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(26 === root_child2.getComputedLeft(), "26 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(0 === root_child2.getComputedWidth(), "0 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(26); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(0); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1043,21 +1043,21 @@ it("justify_content_row_space_evenly", function () { config.free(); } }); -it("justify_content_min_width_with_padding_child_width_greater_than_parent", function () { - var config = Yoga.Config.create(); +test("justify_content_min_width_with_padding_child_width_greater_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setWidth(1000); root.setHeight(1584); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setAlignContent(Yoga.ALIGN_STRETCH); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); @@ -1066,7 +1066,7 @@ it("justify_content_min_width_with_padding_child_width_greater_than_parent", fun root_child0_child0.setMinWidth(400); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0.setWidth(300); @@ -1074,47 +1074,47 @@ it("justify_content_min_width_with_padding_child_width_greater_than_parent", fun root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(1000 === root.getComputedWidth(), "1000 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(1584 === root.getComputedHeight(), "1584 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(1000); + expect(root.getComputedHeight()).toBe(1584); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(1000 === root_child0.getComputedWidth(), "1000 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(1000); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(500); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(100 === root_child0_child0_child0.getComputedLeft(), "100 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(300 === root_child0_child0_child0.getComputedWidth(), "300 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(100); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(300); + expect(root_child0_child0_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(1000 === root.getComputedWidth(), "1000 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(1584 === root.getComputedHeight(), "1584 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(1000); + expect(root.getComputedHeight()).toBe(1584); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(1000 === root_child0.getComputedWidth(), "1000 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(1000); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(500 === root_child0_child0.getComputedLeft(), "500 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(500 === root_child0_child0.getComputedWidth(), "500 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(500); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(500); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(100 === root_child0_child0_child0.getComputedLeft(), "100 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(300 === root_child0_child0_child0.getComputedWidth(), "300 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(100); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(300); + expect(root_child0_child0_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1123,21 +1123,21 @@ it("justify_content_min_width_with_padding_child_width_greater_than_parent", fun config.free(); } }); -it("justify_content_min_width_with_padding_child_width_lower_than_parent", function () { - var config = Yoga.Config.create(); +test("justify_content_min_width_with_padding_child_width_lower_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setWidth(1080); root.setHeight(1584); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setAlignContent(Yoga.ALIGN_STRETCH); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); @@ -1146,7 +1146,7 @@ it("justify_content_min_width_with_padding_child_width_lower_than_parent", funct root_child0_child0.setMinWidth(400); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child0.setWidth(199); @@ -1154,47 +1154,47 @@ it("justify_content_min_width_with_padding_child_width_lower_than_parent", funct root_child0_child0.insertChild(root_child0_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(1584 === root.getComputedHeight(), "1584 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(1080); + expect(root.getComputedHeight()).toBe(1584); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(1080); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(400 === root_child0_child0.getComputedWidth(), "400 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(400); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(101 === root_child0_child0_child0.getComputedLeft(), "101 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(199 === root_child0_child0_child0.getComputedWidth(), "199 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(101); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(199); + expect(root_child0_child0_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(1080 === root.getComputedWidth(), "1080 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(1584 === root.getComputedHeight(), "1584 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(1080); + expect(root.getComputedHeight()).toBe(1584); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(1080 === root_child0.getComputedWidth(), "1080 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(1080); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(680 === root_child0_child0.getComputedLeft(), "680 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(400 === root_child0_child0.getComputedWidth(), "400 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(680); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(400); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(101 === root_child0_child0_child0.getComputedLeft(), "101 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(199 === root_child0_child0_child0.getComputedWidth(), "199 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0_child0.getComputedHeight(), "100 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(101); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(199); + expect(root_child0_child0_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index 46a8a25c..7f5ea2e5 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -7,42 +7,42 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -it("margin_start", function () { - var config = Yoga.Config.create(); +test("margin_start", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_START, 10); root_child0.setWidth(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -51,41 +51,41 @@ it("margin_start", function () { config.free(); } }); -it("margin_top", function () { - var config = Yoga.Config.create(); +test("margin_top", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -94,43 +94,43 @@ it("margin_top", function () { config.free(); } }); -it("margin_end", function () { - var config = Yoga.Config.create(); +test("margin_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_END, 10); root_child0.setWidth(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -139,42 +139,42 @@ it("margin_end", function () { config.free(); } }); -it("margin_bottom", function () { - var config = Yoga.Config.create(); +test("margin_bottom", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -183,43 +183,43 @@ it("margin_bottom", function () { config.free(); } }); -it("margin_and_flex_row", function () { - var config = Yoga.Config.create(); +test("margin_and_flex_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_START, 10); root_child0.setMargin(Yoga.EDGE_END, 10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -228,42 +228,42 @@ it("margin_and_flex_row", function () { config.free(); } }); -it("margin_and_flex_column", function () { - var config = Yoga.Config.create(); +test("margin_and_flex_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -272,43 +272,43 @@ it("margin_and_flex_column", function () { config.free(); } }); -it("margin_and_stretch_row", function () { - var config = Yoga.Config.create(); +test("margin_and_stretch_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -317,42 +317,42 @@ it("margin_and_stretch_row", function () { config.free(); } }); -it("margin_and_stretch_column", function () { - var config = Yoga.Config.create(); +test("margin_and_stretch_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_START, 10); root_child0.setMargin(Yoga.EDGE_END, 10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -361,56 +361,56 @@ it("margin_and_stretch_column", function () { config.free(); } }); -it("margin_with_sibling_row", function () { - var config = Yoga.Config.create(); +test("margin_with_sibling_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_END, 10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(45 === root_child0.getComputedWidth(), "45 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(45); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(55 === root_child1.getComputedLeft(), "55 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(45 === root_child1.getComputedWidth(), "45 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(55); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(45); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(55 === root_child0.getComputedLeft(), "55 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(45 === root_child0.getComputedWidth(), "45 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(55); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(45); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(45 === root_child1.getComputedWidth(), "45 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(45); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -419,55 +419,55 @@ it("margin_with_sibling_row", function () { config.free(); } }); -it("margin_with_sibling_column", function () { - var config = Yoga.Config.create(); +test("margin_with_sibling_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(45 === root_child0.getComputedHeight(), "45 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(45); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(55 === root_child1.getComputedTop(), "55 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(45 === root_child1.getComputedHeight(), "45 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(55); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(45); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(45 === root_child0.getComputedHeight(), "45 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(45); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(55 === root_child1.getComputedTop(), "55 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(45 === root_child1.getComputedHeight(), "45 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(55); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(45); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -476,58 +476,58 @@ it("margin_with_sibling_column", function () { config.free(); } }); -it("margin_auto_bottom", function () { - var config = Yoga.Config.create(); +test("margin_auto_bottom", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -536,58 +536,58 @@ it("margin_auto_bottom", function () { config.free(); } }); -it("margin_auto_top", function () { - var config = Yoga.Config.create(); +test("margin_auto_top", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(100); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(100); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -596,59 +596,59 @@ it("margin_auto_top", function () { config.free(); } }); -it("margin_auto_bottom_and_top", function () { - var config = Yoga.Config.create(); +test("margin_auto_bottom_and_top", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, "auto"); root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -657,59 +657,59 @@ it("margin_auto_bottom_and_top", function () { config.free(); } }); -it("margin_auto_bottom_and_top_justify_center", function () { - var config = Yoga.Config.create(); +test("margin_auto_bottom_and_top_justify_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, "auto"); root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(150); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -718,74 +718,74 @@ it("margin_auto_bottom_and_top_justify_center", function () { config.free(); } }); -it("margin_auto_mutiple_children_column", function () { - var config = Yoga.Config.create(); +test("margin_auto_mutiple_children_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setMargin(Yoga.EDGE_TOP, "auto"); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(25 === root_child0.getComputedTop(), "25 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(25); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(100); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(75 === root_child2.getComputedLeft(), "75 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(150 === root_child2.getComputedTop(), "150 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(75); + expect(root_child2.getComputedTop()).toBe(150); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(25 === root_child0.getComputedTop(), "25 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(25); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(100 === root_child1.getComputedTop(), "100 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(100); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(75 === root_child2.getComputedLeft(), "75 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(150 === root_child2.getComputedTop(), "150 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(75); + expect(root_child2.getComputedTop()).toBe(150); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -794,75 +794,75 @@ it("margin_auto_mutiple_children_column", function () { config.free(); } }); -it("margin_auto_mutiple_children_row", function () { - var config = Yoga.Config.create(); +test("margin_auto_mutiple_children_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(150 === root_child2.getComputedLeft(), "150 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(75 === root_child2.getComputedTop(), "75 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(150); + expect(root_child2.getComputedTop()).toBe(75); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(125 === root_child0.getComputedLeft(), "125 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(125); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(75 === root_child2.getComputedTop(), "75 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(75); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -871,60 +871,60 @@ it("margin_auto_mutiple_children_row", function () { config.free(); } }); -it("margin_auto_left_and_right_column", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_and_right_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -933,58 +933,58 @@ it("margin_auto_left_and_right_column", function () { config.free(); } }); -it("margin_auto_left_and_right", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_and_right", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -993,60 +993,60 @@ it("margin_auto_left_and_right", function () { config.free(); } }); -it("margin_auto_start_and_end_column", function () { - var config = Yoga.Config.create(); +test("margin_auto_start_and_end_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_START, "auto"); root_child0.setMargin(Yoga.EDGE_END, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(75); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1055,58 +1055,58 @@ it("margin_auto_start_and_end_column", function () { config.free(); } }); -it("margin_auto_start_and_end", function () { - var config = Yoga.Config.create(); +test("margin_auto_start_and_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_START, "auto"); root_child0.setMargin(Yoga.EDGE_END, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1115,59 +1115,59 @@ it("margin_auto_start_and_end", function () { config.free(); } }); -it("margin_auto_left_and_right_column_and_center", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_and_right_column_and_center", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1176,58 +1176,58 @@ it("margin_auto_left_and_right_column_and_center", function () { config.free(); } }); -it("margin_auto_left", function () { - var config = Yoga.Config.create(); +test("margin_auto_left", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(150); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(150); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1236,58 +1236,58 @@ it("margin_auto_left", function () { config.free(); } }); -it("margin_auto_right", function () { - var config = Yoga.Config.create(); +test("margin_auto_right", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1296,59 +1296,59 @@ it("margin_auto_right", function () { config.free(); } }); -it("margin_auto_left_and_right_stretch", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_and_right_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1357,58 +1357,58 @@ it("margin_auto_left_and_right_stretch", function () { config.free(); } }); -it("margin_auto_top_and_bottom_stretch", function () { - var config = Yoga.Config.create(); +test("margin_auto_top_and_bottom_stretch", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, "auto"); root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(50 === root_child0.getComputedTop(), "50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(150); + expect(root_child0.getComputedTop()).toBe(50); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(150 === root_child1.getComputedLeft(), "150 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(150); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1417,15 +1417,15 @@ it("margin_auto_top_and_bottom_stretch", function () { config.free(); } }); -it("margin_should_not_be_part_of_max_height", function () { - var config = Yoga.Config.create(); +test("margin_should_not_be_part_of_max_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(250); root.setHeight(250); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_TOP, 20); root_child0.setWidth(100); root_child0.setHeight(100); @@ -1433,27 +1433,27 @@ it("margin_should_not_be_part_of_max_height", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(250); + expect(root.getComputedHeight()).toBe(250); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(250); + expect(root.getComputedHeight()).toBe(250); - console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(150); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1462,15 +1462,15 @@ it("margin_should_not_be_part_of_max_height", function () { config.free(); } }); -it("margin_should_not_be_part_of_max_width", function () { - var config = Yoga.Config.create(); +test("margin_should_not_be_part_of_max_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(250); root.setHeight(250); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, 20); root_child0.setWidth(100); root_child0.setMaxWidth(100); @@ -1478,27 +1478,27 @@ it("margin_should_not_be_part_of_max_width", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(250); + expect(root.getComputedHeight()).toBe(250); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(250 === root.getComputedWidth(), "250 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(250 === root.getComputedHeight(), "250 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(250); + expect(root.getComputedHeight()).toBe(250); - console.assert(150 === root_child0.getComputedLeft(), "150 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(150); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1507,16 +1507,16 @@ it("margin_should_not_be_part_of_max_width", function () { config.free(); } }); -it("margin_auto_left_right_child_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_right_child_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(72); @@ -1524,27 +1524,27 @@ it("margin_auto_left_right_child_bigger_than_parent", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-20 === root_child0.getComputedLeft(), "-20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-20); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1553,43 +1553,43 @@ it("margin_auto_left_right_child_bigger_than_parent", function () { config.free(); } }); -it("margin_auto_left_child_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_child_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-20 === root_child0.getComputedLeft(), "-20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-20); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1598,16 +1598,16 @@ it("margin_auto_left_child_bigger_than_parent", function () { config.free(); } }); -it("margin_fix_left_auto_right_child_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("margin_fix_left_auto_right_child_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, 10); root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); root_child0.setWidth(72); @@ -1615,27 +1615,27 @@ it("margin_fix_left_auto_right_child_bigger_than_parent", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-20 === root_child0.getComputedLeft(), "-20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-20); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1644,16 +1644,16 @@ it("margin_fix_left_auto_right_child_bigger_than_parent", function () { config.free(); } }); -it("margin_auto_left_fix_right_child_bigger_than_parent", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_fix_right_child_bigger_than_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root_child0.setMargin(Yoga.EDGE_RIGHT, 10); root_child0.setWidth(72); @@ -1661,27 +1661,27 @@ it("margin_auto_left_fix_right_child_bigger_than_parent", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(52 === root.getComputedWidth(), "52 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(52 === root.getComputedHeight(), "52 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(52); + expect(root.getComputedHeight()).toBe(52); - console.assert(-30 === root_child0.getComputedLeft(), "-30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-10 === root_child0.getComputedTop(), "-10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(72 === root_child0.getComputedWidth(), "72 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(72 === root_child0.getComputedHeight(), "72 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-30); + expect(root_child0.getComputedTop()).toBe(-10); + expect(root_child0.getComputedWidth()).toBe(72); + expect(root_child0.getComputedHeight()).toBe(72); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1690,59 +1690,59 @@ it("margin_auto_left_fix_right_child_bigger_than_parent", function () { config.free(); } }); -it("margin_auto_top_stretching_child", function () { - var config = Yoga.Config.create(); +test("margin_auto_top_stretching_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); root_child0.setMargin(Yoga.EDGE_TOP, "auto"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(150); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(150); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1751,59 +1751,59 @@ it("margin_auto_top_stretching_child", function () { config.free(); } }); -it("margin_auto_left_stretching_child", function () { - var config = Yoga.Config.create(); +test("margin_auto_left_stretching_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(200 === root_child0.getComputedLeft(), "200 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(200); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(150); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(200 === root_child0.getComputedLeft(), "200 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(150 === root_child0.getComputedHeight(), "150 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(200); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(150); - console.assert(75 === root_child1.getComputedLeft(), "75 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(150 === root_child1.getComputedTop(), "150 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(75); + expect(root_child1.getComputedTop()).toBe(150); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index 5dc664f7..da80ff59 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -7,41 +7,41 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -it("max_width", function () { - var config = Yoga.Config.create(); +test("max_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMaxWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -50,42 +50,42 @@ it("max_width", function () { config.free(); } }); -it("max_height", function () { - var config = Yoga.Config.create(); +test("max_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setMaxHeight(50); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -94,43 +94,43 @@ it("max_height", function () { config.free(); } }); -it("justify_content_min_max", function () { - var config = Yoga.Config.create(); +test("justify_content_min_max", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(60); root_child0.setHeight(60); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(60); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(60); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -139,43 +139,43 @@ it("justify_content_min_max", function () { config.free(); } }); -it("align_items_min_max", function () { - var config = Yoga.Config.create(); +test("align_items_min_max", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setMinWidth(100); root.setMaxWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(60); root_child0.setHeight(60); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(60); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(60); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -184,72 +184,72 @@ it("align_items_min_max", function () { config.free(); } }); -it("justify_content_overflow_min_max", function () { - var config = Yoga.Config.create(); +test("justify_content_overflow_min_max", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMinHeight(100); root.setMaxHeight(110); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(110 === root.getComputedHeight(), "110 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(110); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-20 === root_child0.getComputedTop(), "-20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(-20); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(50 === root.getComputedWidth(), "50 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(110 === root.getComputedHeight(), "110 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(50); + expect(root.getComputedHeight()).toBe(110); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-20 === root_child0.getComputedTop(), "-20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(-20); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(30 === root_child1.getComputedTop(), "30 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(30); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(50); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(80); + expect(root_child2.getComputedWidth()).toBe(50); + expect(root_child2.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -258,56 +258,56 @@ it("justify_content_overflow_min_max", function () { config.free(); } }); -it("flex_grow_to_min", function () { - var config = Yoga.Config.create(); +test("flex_grow_to_min", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -316,57 +316,57 @@ it("flex_grow_to_min", function () { config.free(); } }); -it("flex_grow_in_at_most_container", function () { - var config = Yoga.Config.create(); +test("flex_grow_in_at_most_container", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(0); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(0 === root_child0_child0.getComputedWidth(), "0 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(0); + expect(root_child0_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -375,41 +375,41 @@ it("flex_grow_in_at_most_container", function () { config.free(); } }); -it("flex_grow_child", function () { - var config = Yoga.Config.create(); +test("flex_grow_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(0); root_child0.setHeight(100); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -418,54 +418,54 @@ it("flex_grow_child", function () { config.free(); } }); -it("flex_grow_within_constrained_min_max_column", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_constrained_min_max_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setMinHeight(100); root.setMaxHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -474,56 +474,56 @@ it("flex_grow_within_constrained_min_max_column", function () { config.free(); } }); -it("flex_grow_within_max_width", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_max_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setMaxWidth(100); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -532,56 +532,56 @@ it("flex_grow_within_max_width", function () { config.free(); } }); -it("flex_grow_within_constrained_max_width", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_constrained_max_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setMaxWidth(300); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(200); + expect(root_child0_child0.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0.getComputedHeight(), "20 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(20); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(200); + expect(root_child0_child0.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -590,57 +590,57 @@ it("flex_grow_within_constrained_max_width", function () { config.free(); } }); -it("flex_root_ignored", function () { - var config = Yoga.Config.create(); +test("flex_root_ignored", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexGrow(1); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(200); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(100); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(300); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(200); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(300); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(200 === root_child1.getComputedTop(), "200 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(200); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -649,72 +649,72 @@ it("flex_root_ignored", function () { config.free(); } }); -it("flex_grow_root_minimized", function () { - var config = Yoga.Config.create(); +test("flex_grow_root_minimized", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMinHeight(100); root_child0.setMaxHeight(500); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(200); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setHeight(100); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(300); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(300 === root_child0.getComputedHeight(), "300 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(300); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(200 === root_child0_child1.getComputedTop(), "200 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(200); + expect(root_child0_child1.getComputedWidth()).toBe(100); + expect(root_child0_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(300 === root.getComputedHeight(), "300 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(300); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(300 === root_child0.getComputedHeight(), "300 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(300); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(200 === root_child0_child1.getComputedTop(), "200 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(200); + expect(root_child0_child1.getComputedWidth()).toBe(100); + expect(root_child0_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -723,71 +723,71 @@ it("flex_grow_root_minimized", function () { config.free(); } }); -it("flex_grow_height_maximized", function () { - var config = Yoga.Config.create(); +test("flex_grow_height_maximized", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMinHeight(100); root_child0.setMaxHeight(500); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(200); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setHeight(100); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(500 === root_child0.getComputedHeight(), "500 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(500); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(400 === root_child0_child0.getComputedHeight(), "400 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(400); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(400 === root_child0_child1.getComputedTop(), "400 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(400); + expect(root_child0_child1.getComputedWidth()).toBe(100); + expect(root_child0_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(500); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(500 === root_child0.getComputedHeight(), "500 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(500); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(400 === root_child0_child0.getComputedHeight(), "400 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(400); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(400 === root_child0_child1.getComputedTop(), "400 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(100 === root_child0_child1.getComputedWidth(), "100 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(400); + expect(root_child0_child1.getComputedWidth()).toBe(100); + expect(root_child0_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -796,55 +796,55 @@ it("flex_grow_height_maximized", function () { config.free(); } }); -it("flex_grow_within_constrained_min_row", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_constrained_min_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setMinWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child1.getComputedLeft(), "50 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(50); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(50); + expect(root_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -853,53 +853,53 @@ it("flex_grow_within_constrained_min_row", function () { config.free(); } }); -it("flex_grow_within_constrained_min_column", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_constrained_min_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setMinHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(0); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -908,70 +908,70 @@ it("flex_grow_within_constrained_min_column", function () { config.free(); } }); -it("flex_grow_within_constrained_max_row", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_constrained_max_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setMaxWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexShrink(1); root_child0_child0.setFlexBasis(100); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth(50); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child0_child1.getComputedLeft(), "50 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(50 === root_child0_child1.getComputedWidth(), "50 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(50); + expect(root_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child1.getComputedWidth()).toBe(50); + expect(root_child0_child1.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(50 === root_child0_child0.getComputedLeft(), "50 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0.getComputedWidth(), "50 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(50); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(50 === root_child0_child1.getComputedWidth(), "50 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child1.getComputedWidth()).toBe(50); + expect(root_child0_child1.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -980,55 +980,55 @@ it("flex_grow_within_constrained_max_row", function () { config.free(); } }); -it("flex_grow_within_constrained_max_column", function () { - var config = Yoga.Config.create(); +test("flex_grow_within_constrained_max_column", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setMaxHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexShrink(1); root_child0.setFlexBasis(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1037,59 +1037,59 @@ it("flex_grow_within_constrained_max_column", function () { config.free(); } }); -it("child_min_max_width_flexing", function () { - var config = Yoga.Config.create(); +test("child_min_max_width_flexing", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(120); root.setHeight(50); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(0); root_child0.setMinWidth(60); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexBasis("50%"); root_child1.setMaxWidth(20); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(120 === root.getComputedWidth(), "120 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(120); + expect(root.getComputedHeight()).toBe(50); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(100); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(120 === root.getComputedWidth(), "120 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(120); + expect(root.getComputedHeight()).toBe(50); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(20); + expect(root_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1098,26 +1098,26 @@ it("child_min_max_width_flexing", function () { config.free(); } }); -it("min_width_overrides_width", function () { - var config = Yoga.Config.create(); +test("min_width_overrides_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(50); root.setMinWidth(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1126,26 +1126,26 @@ it("min_width_overrides_width", function () { config.free(); } }); -it("max_width_overrides_width", function () { - var config = Yoga.Config.create(); +test("max_width_overrides_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setMaxWidth(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1154,26 +1154,26 @@ it("max_width_overrides_width", function () { config.free(); } }); -it("min_height_overrides_height", function () { - var config = Yoga.Config.create(); +test("min_height_overrides_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setHeight(50); root.setMinHeight(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1182,26 +1182,26 @@ it("min_height_overrides_height", function () { config.free(); } }); -it("max_height_overrides_height", function () { - var config = Yoga.Config.create(); +test("max_height_overrides_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setHeight(200); root.setMaxHeight(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1210,16 +1210,16 @@ it("max_height_overrides_height", function () { config.free(); } }); -it("min_max_percent_no_width_height", function () { - var config = Yoga.Config.create(); +test("min_max_percent_no_width_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setMinWidth("10%"); root_child0.setMaxWidth("10%"); root_child0.setMinHeight("10%"); @@ -1227,27 +1227,27 @@ it("min_max_percent_no_width_height", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index 7c66af06..b6257fc8 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -7,28 +7,28 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -it("padding_no_size", function () { - var config = Yoga.Config.create(); +test("padding_no_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_BOTTOM, 10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(20); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(20); + expect(root.getComputedHeight()).toBe(20); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -37,43 +37,43 @@ it("padding_no_size", function () { config.free(); } }); -it("padding_container_match_child", function () { - var config = Yoga.Config.create(); +test("padding_container_match_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_BOTTOM, 10); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(30); + expect(root.getComputedHeight()).toBe(30); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(30 === root.getComputedWidth(), "30 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(30 === root.getComputedHeight(), "30 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(30); + expect(root.getComputedHeight()).toBe(30); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -82,11 +82,11 @@ it("padding_container_match_child", function () { config.free(); } }); -it("padding_flex_child", function () { - var config = Yoga.Config.create(); +test("padding_flex_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); @@ -94,33 +94,33 @@ it("padding_flex_child", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(80); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(80); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -129,11 +129,11 @@ it("padding_flex_child", function () { config.free(); } }); -it("padding_stretch_child", function () { - var config = Yoga.Config.create(); +test("padding_stretch_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); @@ -141,32 +141,32 @@ it("padding_stretch_child", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(10 === root_child0.getComputedLeft(), "10 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(10); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(80); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -175,11 +175,11 @@ it("padding_stretch_child", function () { config.free(); } }); -it("padding_center_child", function () { - var config = Yoga.Config.create(); +test("padding_center_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setPadding(Yoga.EDGE_START, 10); @@ -188,33 +188,33 @@ it("padding_center_child", function () { root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(35); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(35); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -223,17 +223,17 @@ it("padding_center_child", function () { config.free(); } }); -it("child_with_padding_align_end", function () { - var config = Yoga.Config.create(); +test("child_with_padding_align_end", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPadding(Yoga.EDGE_LEFT, 20); root_child0.setPadding(Yoga.EDGE_TOP, 20); root_child0.setPadding(Yoga.EDGE_RIGHT, 20); @@ -243,27 +243,27 @@ it("child_with_padding_align_end", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(100 === root_child0.getComputedLeft(), "100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(100); + expect(root_child0.getComputedTop()).toBe(100); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(100); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index d9193507..3f39ee6c 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -7,42 +7,42 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -it("percentage_width_height", function () { - var config = Yoga.Config.create(); +test("percentage_width_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth("30%"); root_child0.setHeight("30%"); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(60); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(140 === root_child0.getComputedLeft(), "140 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(140); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(60); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -51,16 +51,16 @@ it("percentage_width_height", function () { config.free(); } }); -it("percentage_position_left_top", function () { - var config = Yoga.Config.create(); +test("percentage_position_left_top", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(400); root.setHeight(400); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPosition(Yoga.EDGE_LEFT, "10%"); root_child0.setPosition(Yoga.EDGE_TOP, "20%"); root_child0.setWidth("45%"); @@ -68,27 +68,27 @@ it("percentage_position_left_top", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(400 === root.getComputedWidth(), "400 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(400 === root.getComputedHeight(), "400 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(400); + expect(root.getComputedHeight()).toBe(400); - console.assert(40 === root_child0.getComputedLeft(), "40 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(180 === root_child0.getComputedWidth(), "180 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(220 === root_child0.getComputedHeight(), "220 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(180); + expect(root_child0.getComputedHeight()).toBe(220); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(400 === root.getComputedWidth(), "400 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(400 === root.getComputedHeight(), "400 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(400); + expect(root.getComputedHeight()).toBe(400); - console.assert(260 === root_child0.getComputedLeft(), "260 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(180 === root_child0.getComputedWidth(), "180 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(220 === root_child0.getComputedHeight(), "220 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(260); + expect(root_child0.getComputedTop()).toBe(80); + expect(root_child0.getComputedWidth()).toBe(180); + expect(root_child0.getComputedHeight()).toBe(220); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -97,16 +97,16 @@ it("percentage_position_left_top", function () { config.free(); } }); -it("percentage_position_bottom_right", function () { - var config = Yoga.Config.create(); +test("percentage_position_bottom_right", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(500); root.setHeight(500); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPosition(Yoga.EDGE_RIGHT, "20%"); root_child0.setPosition(Yoga.EDGE_BOTTOM, "10%"); root_child0.setWidth("55%"); @@ -114,27 +114,27 @@ it("percentage_position_bottom_right", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(-100 === root_child0.getComputedLeft(), "-100 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-50 === root_child0.getComputedTop(), "-50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(275 === root_child0.getComputedWidth(), "275 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(-100); + expect(root_child0.getComputedTop()).toBe(-50); + expect(root_child0.getComputedWidth()).toBe(275); + expect(root_child0.getComputedHeight()).toBe(75); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(500 === root.getComputedWidth(), "500 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(500 === root.getComputedHeight(), "500 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(500); + expect(root.getComputedHeight()).toBe(500); - console.assert(125 === root_child0.getComputedLeft(), "125 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(-50 === root_child0.getComputedTop(), "-50 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(275 === root_child0.getComputedWidth(), "275 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(75 === root_child0.getComputedHeight(), "75 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(125); + expect(root_child0.getComputedTop()).toBe(-50); + expect(root_child0.getComputedWidth()).toBe(275); + expect(root_child0.getComputedHeight()).toBe(75); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -143,57 +143,57 @@ it("percentage_position_bottom_right", function () { config.free(); } }); -it("percentage_flex_basis", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("50%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexBasis("25%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(125 === root_child0.getComputedWidth(), "125 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(125); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(125 === root_child1.getComputedLeft(), "125 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(75 === root_child1.getComputedWidth(), "75 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(125); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(75); + expect(root_child1.getComputedHeight()).toBe(200); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(75 === root_child0.getComputedLeft(), "75 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(125 === root_child0.getComputedWidth(), "125 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(75); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(125); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(75 === root_child1.getComputedWidth(), "75 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(75); + expect(root_child1.getComputedHeight()).toBe(200); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -202,56 +202,56 @@ it("percentage_flex_basis", function () { config.free(); } }); -it("percentage_flex_basis_cross", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_cross", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("50%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexBasis("25%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(125 === root_child0.getComputedHeight(), "125 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(125); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(125 === root_child1.getComputedTop(), "125 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(75 === root_child1.getComputedHeight(), "75 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(125); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(75); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(125 === root_child0.getComputedHeight(), "125 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(125); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(125 === root_child1.getComputedTop(), "125 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(75 === root_child1.getComputedHeight(), "75 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(125); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(75); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -260,59 +260,59 @@ it("percentage_flex_basis_cross", function () { config.free(); } }); -it("percentage_flex_basis_main_max_height", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_main_max_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("10%"); root_child0.setMaxHeight("60%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("10%"); root_child1.setMaxHeight("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(52 === root_child0.getComputedWidth(), "52 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(52); + expect(root_child0.getComputedHeight()).toBe(120); - console.assert(52 === root_child1.getComputedLeft(), "52 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(148 === root_child1.getComputedWidth(), "148 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(52); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(148); + expect(root_child1.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(148 === root_child0.getComputedLeft(), "148 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(52 === root_child0.getComputedWidth(), "52 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(148); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(52); + expect(root_child0.getComputedHeight()).toBe(120); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(148 === root_child1.getComputedWidth(), "148 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(148); + expect(root_child1.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -321,58 +321,58 @@ it("percentage_flex_basis_main_max_height", function () { config.free(); } }); -it("percentage_flex_basis_cross_max_height", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_cross_max_height", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("10%"); root_child0.setMaxHeight("60%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("10%"); root_child1.setMaxHeight("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(120); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(120 === root_child1.getComputedTop(), "120 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(120); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(40); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(120 === root_child0.getComputedHeight(), "120 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(120); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(120 === root_child1.getComputedTop(), "120 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(40 === root_child1.getComputedHeight(), "40 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(120); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(40); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -381,59 +381,59 @@ it("percentage_flex_basis_cross_max_height", function () { config.free(); } }); -it("percentage_flex_basis_main_max_width", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_main_max_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("15%"); root_child0.setMaxWidth("60%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("10%"); root_child1.setMaxWidth("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(120); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(120 === root_child1.getComputedLeft(), "120 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(120); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(40); + expect(root_child1.getComputedHeight()).toBe(200); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(120); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(40 === root_child1.getComputedLeft(), "40 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(40); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(40); + expect(root_child1.getComputedHeight()).toBe(200); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -442,58 +442,58 @@ it("percentage_flex_basis_main_max_width", function () { config.free(); } }); -it("percentage_flex_basis_cross_max_width", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_cross_max_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("10%"); root_child0.setMaxWidth("60%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("15%"); root_child1.setMaxWidth("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(120); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(40); + expect(root_child1.getComputedHeight()).toBe(150); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(120); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(160 === root_child1.getComputedLeft(), "160 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(40 === root_child1.getComputedWidth(), "40 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(160); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(40); + expect(root_child1.getComputedHeight()).toBe(150); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -502,59 +502,59 @@ it("percentage_flex_basis_cross_max_width", function () { config.free(); } }); -it("percentage_flex_basis_main_min_width", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_main_min_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("15%"); root_child0.setMinWidth("60%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("10%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(120); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(120 === root_child1.getComputedLeft(), "120 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(80 === root_child1.getComputedWidth(), "80 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(120); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(80); + expect(root_child1.getComputedHeight()).toBe(200); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(80 === root_child0.getComputedLeft(), "80 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(120 === root_child0.getComputedWidth(), "120 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(80); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(120); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(80 === root_child1.getComputedWidth(), "80 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(200 === root_child1.getComputedHeight(), "200 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(80); + expect(root_child1.getComputedHeight()).toBe(200); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -563,58 +563,58 @@ it("percentage_flex_basis_main_min_width", function () { config.free(); } }); -it("percentage_flex_basis_cross_min_width", function () { - var config = Yoga.Config.create(); +test("percentage_flex_basis_cross_min_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("10%"); root_child0.setMinWidth("60%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("15%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(150); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(150 === root_child1.getComputedHeight(), "150 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(50); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(150); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -623,15 +623,15 @@ it("percentage_flex_basis_cross_min_width", function () { config.free(); } }); -it("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () { - var config = Yoga.Config.create(); +test("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("10%"); root_child0.setMargin(Yoga.EDGE_LEFT, 5); @@ -645,7 +645,7 @@ it("percentage_multiple_nested_with_padding_margin_and_percentage_values", funct root_child0.setMinWidth("60%"); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setMargin(Yoga.EDGE_LEFT, 5); root_child0_child0.setMargin(Yoga.EDGE_TOP, 5); root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 5); @@ -657,7 +657,7 @@ it("percentage_multiple_nested_with_padding_margin_and_percentage_values", funct root_child0_child0.setWidth("50%"); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setMargin(Yoga.EDGE_LEFT, "5%"); root_child0_child0_child0.setMargin(Yoga.EDGE_TOP, "5%"); root_child0_child0_child0.setMargin(Yoga.EDGE_RIGHT, "5%"); @@ -669,64 +669,64 @@ it("percentage_multiple_nested_with_padding_margin_and_percentage_values", funct root_child0_child0_child0.setWidth("45%"); root_child0_child0.insertChild(root_child0_child0_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(4); root_child1.setFlexBasis("15%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(190 === root_child0.getComputedWidth(), "190 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(48 === root_child0.getComputedHeight(), "48 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(5); + expect(root_child0.getComputedWidth()).toBe(190); + expect(root_child0.getComputedHeight()).toBe(48); - console.assert(8 === root_child0_child0.getComputedLeft(), "8 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(8 === root_child0_child0.getComputedTop(), "8 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(92 === root_child0_child0.getComputedWidth(), "92 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(25 === root_child0_child0.getComputedHeight(), "25 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(8); + expect(root_child0_child0.getComputedTop()).toBe(8); + expect(root_child0_child0.getComputedWidth()).toBe(92); + expect(root_child0_child0.getComputedHeight()).toBe(25); - console.assert(10 === root_child0_child0_child0.getComputedLeft(), "10 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0_child0_child0.getComputedTop(), "10 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(36 === root_child0_child0_child0.getComputedWidth(), "36 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(6 === root_child0_child0_child0.getComputedHeight(), "6 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(10); + expect(root_child0_child0_child0.getComputedTop()).toBe(10); + expect(root_child0_child0_child0.getComputedWidth()).toBe(36); + expect(root_child0_child0_child0.getComputedHeight()).toBe(6); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(58 === root_child1.getComputedTop(), "58 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(142 === root_child1.getComputedHeight(), "142 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(58); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(142); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(5 === root_child0.getComputedLeft(), "5 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(5 === root_child0.getComputedTop(), "5 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(190 === root_child0.getComputedWidth(), "190 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(48 === root_child0.getComputedHeight(), "48 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(5); + expect(root_child0.getComputedTop()).toBe(5); + expect(root_child0.getComputedWidth()).toBe(190); + expect(root_child0.getComputedHeight()).toBe(48); - console.assert(90 === root_child0_child0.getComputedLeft(), "90 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(8 === root_child0_child0.getComputedTop(), "8 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(92 === root_child0_child0.getComputedWidth(), "92 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(25 === root_child0_child0.getComputedHeight(), "25 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(90); + expect(root_child0_child0.getComputedTop()).toBe(8); + expect(root_child0_child0.getComputedWidth()).toBe(92); + expect(root_child0_child0.getComputedHeight()).toBe(25); - console.assert(46 === root_child0_child0_child0.getComputedLeft(), "46 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0_child0_child0.getComputedTop(), "10 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(36 === root_child0_child0_child0.getComputedWidth(), "36 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(6 === root_child0_child0_child0.getComputedHeight(), "6 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(46); + expect(root_child0_child0_child0.getComputedTop()).toBe(10); + expect(root_child0_child0_child0.getComputedWidth()).toBe(36); + expect(root_child0_child0_child0.getComputedHeight()).toBe(6); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(58 === root_child1.getComputedTop(), "58 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(200 === root_child1.getComputedWidth(), "200 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(142 === root_child1.getComputedHeight(), "142 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(58); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(142); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -735,15 +735,15 @@ it("percentage_multiple_nested_with_padding_margin_and_percentage_values", funct config.free(); } }); -it("percentage_margin_should_calculate_based_only_on_width", function () { - var config = Yoga.Config.create(); +test("percentage_margin_should_calculate_based_only_on_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setMargin(Yoga.EDGE_LEFT, "10%"); root_child0.setMargin(Yoga.EDGE_TOP, "10%"); @@ -751,43 +751,43 @@ it("percentage_margin_should_calculate_based_only_on_width", function () { root_child0.setMargin(Yoga.EDGE_BOTTOM, "10%"); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(160 === root_child0.getComputedWidth(), "160 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(160); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(10); + expect(root_child0_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(20 === root_child0.getComputedLeft(), "20 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(160 === root_child0.getComputedWidth(), "160 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(20); + expect(root_child0.getComputedTop()).toBe(20); + expect(root_child0.getComputedWidth()).toBe(160); + expect(root_child0.getComputedHeight()).toBe(60); - console.assert(150 === root_child0_child0.getComputedLeft(), "150 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(150); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(10); + expect(root_child0_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -796,15 +796,15 @@ it("percentage_margin_should_calculate_based_only_on_width", function () { config.free(); } }); -it("percentage_padding_should_calculate_based_only_on_width", function () { - var config = Yoga.Config.create(); +test("percentage_padding_should_calculate_based_only_on_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setPadding(Yoga.EDGE_LEFT, "10%"); root_child0.setPadding(Yoga.EDGE_TOP, "10%"); @@ -812,43 +812,43 @@ it("percentage_padding_should_calculate_based_only_on_width", function () { root_child0.setPadding(Yoga.EDGE_BOTTOM, "10%"); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(20 === root_child0_child0.getComputedLeft(), "20 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0_child0.getComputedTop(), "20 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(20); + expect(root_child0_child0.getComputedTop()).toBe(20); + expect(root_child0_child0.getComputedWidth()).toBe(10); + expect(root_child0_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(200 === root_child0.getComputedWidth(), "200 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(170 === root_child0_child0.getComputedLeft(), "170 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(20 === root_child0_child0.getComputedTop(), "20 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(10 === root_child0_child0.getComputedWidth(), "10 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0_child0.getComputedHeight(), "10 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(170); + expect(root_child0_child0.getComputedTop()).toBe(20); + expect(root_child0_child0.getComputedWidth()).toBe(10); + expect(root_child0_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -857,15 +857,15 @@ it("percentage_padding_should_calculate_based_only_on_width", function () { config.free(); } }); -it("percentage_absolute_position", function () { - var config = Yoga.Config.create(); +test("percentage_absolute_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_LEFT, "30%"); root_child0.setPosition(Yoga.EDGE_TOP, "10%"); @@ -874,27 +874,27 @@ it("percentage_absolute_position", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(100); - console.assert(60 === root_child0.getComputedLeft(), "60 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(60); + expect(root_child0.getComputedTop()).toBe(10); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -903,39 +903,39 @@ it("percentage_absolute_position", function () { config.free(); } }); -it("percentage_width_height_undefined_parent_size", function () { - var config = Yoga.Config.create(); +test("percentage_width_height_undefined_parent_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth("50%"); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(0); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(0 === root.getComputedWidth(), "0 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(0 === root.getComputedHeight(), "0 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(0); + expect(root.getComputedHeight()).toBe(0); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(0 === root_child0.getComputedWidth(), "0 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(0 === root_child0.getComputedHeight(), "0 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(0); + expect(root_child0.getComputedHeight()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -944,83 +944,83 @@ it("percentage_width_height_undefined_parent_size", function () { config.free(); } }); -it("percent_within_flex_grow", function () { - var config = Yoga.Config.create(); +test("percent_within_flex_grow", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(350); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setWidth("100%"); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setWidth(100); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(350 === root.getComputedWidth(), "350 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(350); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(150 === root_child1.getComputedWidth(), "150 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(100); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(150); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(150 === root_child1_child0.getComputedWidth(), "150 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(150); + expect(root_child1_child0.getComputedHeight()).toBe(0); - console.assert(250 === root_child2.getComputedLeft(), "250 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(250); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(350 === root.getComputedWidth(), "350 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(350); + expect(root.getComputedHeight()).toBe(100); - console.assert(250 === root_child0.getComputedLeft(), "250 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(250); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(100 === root_child1.getComputedLeft(), "100 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(150 === root_child1.getComputedWidth(), "150 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(100); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(150); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(150 === root_child1_child0.getComputedWidth(), "150 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(0 === root_child1_child0.getComputedHeight(), "0 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(150); + expect(root_child1_child0.getComputedHeight()).toBe(0); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1029,87 +1029,87 @@ it("percent_within_flex_grow", function () { config.free(); } }); -it("percentage_container_in_wrapping_container", function () { - var config = Yoga.Config.create(); +test("percentage_container_in_wrapping_container", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); root_child0_child0.setWidth("100%"); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child0_child0 = Yoga.Node.create(config); + const root_child0_child0_child0 = Yoga.Node.create(config); root_child0_child0_child0.setWidth(50); root_child0_child0_child0.setHeight(50); root_child0_child0.insertChild(root_child0_child0_child0, 0); - var root_child0_child0_child1 = Yoga.Node.create(config); + const root_child0_child0_child1 = Yoga.Node.create(config); root_child0_child0_child1.setWidth(50); root_child0_child0_child1.setHeight(50); root_child0_child0.insertChild(root_child0_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0_child0.getComputedLeft(), "0 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0_child0.getComputedWidth(), "50 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0_child0.getComputedHeight(), "50 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child0_child0_child1.getComputedLeft(), "50 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")"); - console.assert(50 === root_child0_child0_child1.getComputedWidth(), "50 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0_child1.getComputedHeight(), "50 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1.getComputedLeft()).toBe(50); + expect(root_child0_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child0_child1.getComputedWidth()).toBe(50); + expect(root_child0_child0_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(200 === root.getComputedWidth(), "200 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(200 === root.getComputedHeight(), "200 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(75 === root_child0.getComputedTop(), "75 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(75); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(50 === root_child0_child0_child0.getComputedLeft(), "50 === root_child0_child0_child0.getComputedLeft() (" + root_child0_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child0.getComputedTop(), "0 === root_child0_child0_child0.getComputedTop() (" + root_child0_child0_child0.getComputedTop() + ")"); - console.assert(50 === root_child0_child0_child0.getComputedWidth(), "50 === root_child0_child0_child0.getComputedWidth() (" + root_child0_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0_child0.getComputedHeight(), "50 === root_child0_child0_child0.getComputedHeight() (" + root_child0_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0_child0.getComputedLeft()).toBe(50); + expect(root_child0_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0_child0.getComputedWidth()).toBe(50); + expect(root_child0_child0_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0_child1.getComputedLeft(), "0 === root_child0_child0_child1.getComputedLeft() (" + root_child0_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0_child1.getComputedTop(), "0 === root_child0_child0_child1.getComputedTop() (" + root_child0_child0_child1.getComputedTop() + ")"); - console.assert(50 === root_child0_child0_child1.getComputedWidth(), "50 === root_child0_child0_child1.getComputedWidth() (" + root_child0_child0_child1.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0_child1.getComputedHeight(), "50 === root_child0_child0_child1.getComputedHeight() (" + root_child0_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child0_child1.getComputedWidth()).toBe(50); + expect(root_child0_child0_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -1118,15 +1118,15 @@ it("percentage_container_in_wrapping_container", function () { config.free(); } }); -it("percent_absolute_position", function () { - var config = Yoga.Config.create(); +test("percent_absolute_position", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(60); root.setHeight(50); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); root_child0.setPosition(Yoga.EDGE_LEFT, "50%"); @@ -1134,56 +1134,56 @@ it("percent_absolute_position", function () { root_child0.setHeight(50); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth("100%"); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth("100%"); root_child0.insertChild(root_child0_child1, 1); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(60); + expect(root.getComputedHeight()).toBe(50); - console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(30); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(60 === root_child0_child0.getComputedWidth(), "60 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(60); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(60 === root_child0_child1.getComputedLeft(), "60 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(60 === root_child0_child1.getComputedWidth(), "60 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(50 === root_child0_child1.getComputedHeight(), "50 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(60); + expect(root_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child1.getComputedWidth()).toBe(60); + expect(root_child0_child1.getComputedHeight()).toBe(50); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(60 === root.getComputedWidth(), "60 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(50 === root.getComputedHeight(), "50 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(60); + expect(root.getComputedHeight()).toBe(50); - console.assert(30 === root_child0.getComputedLeft(), "30 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(30); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(50); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(60 === root_child0_child0.getComputedWidth(), "60 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(50 === root_child0_child0.getComputedHeight(), "50 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(60); + expect(root_child0_child0.getComputedHeight()).toBe(50); - console.assert(-60 === root_child0_child1.getComputedLeft(), "-60 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(60 === root_child0_child1.getComputedWidth(), "60 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(50 === root_child0_child1.getComputedHeight(), "50 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(-60); + expect(root_child0_child1.getComputedTop()).toBe(0); + expect(root_child0_child1.getComputedWidth()).toBe(60); + expect(root_child0_child1.getComputedHeight()).toBe(50); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index d599175f..8e05cf1d 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -7,69 +7,69 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -it("rounding_flex_basis_flex_grow_row_width_of_100", function () { - var config = Yoga.Config.create(); +test("rounding_flex_basis_flex_grow_row_width_of_100", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(33 === root_child0.getComputedWidth(), "33 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(33); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(33 === root_child1.getComputedLeft(), "33 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(34 === root_child1.getComputedWidth(), "34 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(33); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(34); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(67 === root_child2.getComputedLeft(), "67 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(67); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(33); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(67 === root_child0.getComputedLeft(), "67 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(33 === root_child0.getComputedWidth(), "33 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(67); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(33); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(33 === root_child1.getComputedLeft(), "33 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(34 === root_child1.getComputedWidth(), "34 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(33); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(34); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(33); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -78,97 +78,97 @@ it("rounding_flex_basis_flex_grow_row_width_of_100", function () { config.free(); } }); -it("rounding_flex_basis_flex_grow_row_prime_number_width", function () { - var config = Yoga.Config.create(); +test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(113); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root.insertChild(root_child2, 2); - var root_child3 = Yoga.Node.create(config); + const root_child3 = Yoga.Node.create(config); root_child3.setFlexGrow(1); root.insertChild(root_child3, 3); - var root_child4 = Yoga.Node.create(config); + const root_child4 = Yoga.Node.create(config); root_child4.setFlexGrow(1); root.insertChild(root_child4, 4); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(113 === root.getComputedWidth(), "113 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(113); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(23 === root_child0.getComputedWidth(), "23 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(23); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(23 === root_child1.getComputedLeft(), "23 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(22 === root_child1.getComputedWidth(), "22 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(23); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(22); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(45 === root_child2.getComputedLeft(), "45 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(23 === root_child2.getComputedWidth(), "23 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(45); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(23); + expect(root_child2.getComputedHeight()).toBe(100); - console.assert(68 === root_child3.getComputedLeft(), "68 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(22 === root_child3.getComputedWidth(), "22 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(68); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(22); + expect(root_child3.getComputedHeight()).toBe(100); - console.assert(90 === root_child4.getComputedLeft(), "90 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(90); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(23); + expect(root_child4.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(113 === root.getComputedWidth(), "113 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(113); + expect(root.getComputedHeight()).toBe(100); - console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(23 === root_child0.getComputedWidth(), "23 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(90); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(23); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(68 === root_child1.getComputedLeft(), "68 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(22 === root_child1.getComputedWidth(), "22 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(68); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(22); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(45 === root_child2.getComputedLeft(), "45 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(23 === root_child2.getComputedWidth(), "23 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(45); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(23); + expect(root_child2.getComputedHeight()).toBe(100); - console.assert(23 === root_child3.getComputedLeft(), "23 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")"); - console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")"); - console.assert(22 === root_child3.getComputedWidth(), "22 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")"); - console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")"); + expect(root_child3.getComputedLeft()).toBe(23); + expect(root_child3.getComputedTop()).toBe(0); + expect(root_child3.getComputedWidth()).toBe(22); + expect(root_child3.getComputedHeight()).toBe(100); - console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")"); - console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")"); - console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")"); - console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")"); + expect(root_child4.getComputedLeft()).toBe(0); + expect(root_child4.getComputedTop()).toBe(0); + expect(root_child4.getComputedWidth()).toBe(23); + expect(root_child4.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -177,70 +177,70 @@ it("rounding_flex_basis_flex_grow_row_prime_number_width", function () { config.free(); } }); -it("rounding_flex_basis_flex_shrink_row", function () { - var config = Yoga.Config.create(); +test("rounding_flex_basis_flex_shrink_row", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(101); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexShrink(1); root_child0.setFlexBasis(100); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(25); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexBasis(25); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(101 === root.getComputedWidth(), "101 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(101); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(51 === root_child0.getComputedWidth(), "51 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(51); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(51 === root_child1.getComputedLeft(), "51 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(51); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(25); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(76 === root_child2.getComputedLeft(), "76 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(76); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(25); + expect(root_child2.getComputedHeight()).toBe(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(101 === root.getComputedWidth(), "101 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(101); + expect(root.getComputedHeight()).toBe(100); - console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(51 === root_child0.getComputedWidth(), "51 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(50); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(51); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(25 === root_child1.getComputedLeft(), "25 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(25); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(25); + expect(root_child1.getComputedHeight()).toBe(100); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(25); + expect(root_child2.getComputedHeight()).toBe(100); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -249,72 +249,72 @@ it("rounding_flex_basis_flex_shrink_row", function () { config.free(); } }); -it("rounding_flex_basis_overrides_main_size", function () { - var config = Yoga.Config.create(); +test("rounding_flex_basis_overrides_main_size", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(113); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(64); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(24); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(64); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(24); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -323,72 +323,72 @@ it("rounding_flex_basis_overrides_main_size", function () { config.free(); } }); -it("rounding_total_fractial", function () { - var config = Yoga.Config.create(); +test("rounding_total_fractial", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(87.4); root.setHeight(113.4); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(0.7); root_child0.setFlexBasis(50.3); root_child0.setHeight(20.3); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1.6); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1.1); root_child2.setHeight(10.7); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(87); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(87); + expect(root_child0.getComputedHeight()).toBe(59); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(59); + expect(root_child1.getComputedWidth()).toBe(87); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(87); + expect(root_child2.getComputedHeight()).toBe(24); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(87); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(87); + expect(root_child0.getComputedHeight()).toBe(59); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(59); + expect(root_child1.getComputedWidth()).toBe(87); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(87); + expect(root_child2.getComputedHeight()).toBe(24); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -397,106 +397,106 @@ it("rounding_total_fractial", function () { config.free(); } }); -it("rounding_total_fractial_nested", function () { - var config = Yoga.Config.create(); +test("rounding_total_fractial_nested", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(87.4); root.setHeight(113.4); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(0.7); root_child0.setFlexBasis(50.3); root_child0.setHeight(20.3); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(0.3); root_child0_child0.setPosition(Yoga.EDGE_BOTTOM, 13.3); root_child0_child0.setHeight(9.9); root_child0.insertChild(root_child0_child0, 0); - var root_child0_child1 = Yoga.Node.create(config); + const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setFlexGrow(4); root_child0_child1.setFlexBasis(0.3); root_child0_child1.setPosition(Yoga.EDGE_TOP, 13.3); root_child0_child1.setHeight(1.1); root_child0.insertChild(root_child0_child1, 1); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1.6); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1.1); root_child2.setHeight(10.7); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(87); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(87); + expect(root_child0.getComputedHeight()).toBe(59); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(-13 === root_child0_child0.getComputedTop(), "-13 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(87 === root_child0_child0.getComputedWidth(), "87 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(12 === root_child0_child0.getComputedHeight(), "12 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(-13); + expect(root_child0_child0.getComputedWidth()).toBe(87); + expect(root_child0_child0.getComputedHeight()).toBe(12); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(25 === root_child0_child1.getComputedTop(), "25 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(87 === root_child0_child1.getComputedWidth(), "87 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(47 === root_child0_child1.getComputedHeight(), "47 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(25); + expect(root_child0_child1.getComputedWidth()).toBe(87); + expect(root_child0_child1.getComputedHeight()).toBe(47); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(59); + expect(root_child1.getComputedWidth()).toBe(87); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(87); + expect(root_child2.getComputedHeight()).toBe(24); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(87); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(87); + expect(root_child0.getComputedHeight()).toBe(59); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(-13 === root_child0_child0.getComputedTop(), "-13 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(87 === root_child0_child0.getComputedWidth(), "87 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(12 === root_child0_child0.getComputedHeight(), "12 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(-13); + expect(root_child0_child0.getComputedWidth()).toBe(87); + expect(root_child0_child0.getComputedHeight()).toBe(12); - console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")"); - console.assert(25 === root_child0_child1.getComputedTop(), "25 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")"); - console.assert(87 === root_child0_child1.getComputedWidth(), "87 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")"); - console.assert(47 === root_child0_child1.getComputedHeight(), "47 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")"); + expect(root_child0_child1.getComputedLeft()).toBe(0); + expect(root_child0_child1.getComputedTop()).toBe(25); + expect(root_child0_child1.getComputedWidth()).toBe(87); + expect(root_child0_child1.getComputedHeight()).toBe(47); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(59); + expect(root_child1.getComputedWidth()).toBe(87); + expect(root_child1.getComputedHeight()).toBe(30); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(87); + expect(root_child2.getComputedHeight()).toBe(24); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -505,72 +505,72 @@ it("rounding_total_fractial_nested", function () { config.free(); } }); -it("rounding_fractial_input_1", function () { - var config = Yoga.Config.create(); +test("rounding_fractial_input_1", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(113.4); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(64); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(24); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(64); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(24); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -579,72 +579,72 @@ it("rounding_fractial_input_1", function () { config.free(); } }); -it("rounding_fractial_input_2", function () { - var config = Yoga.Config.create(); +test("rounding_fractial_input_2", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(113.6); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(114); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(65); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(65 === root_child1.getComputedTop(), "65 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(65); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(24); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(25); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(114); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(65); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(65 === root_child1.getComputedTop(), "65 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(65); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(24); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(25); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -653,73 +653,73 @@ it("rounding_fractial_input_2", function () { config.free(); } }); -it("rounding_fractial_input_3", function () { - var config = Yoga.Config.create(); +test("rounding_fractial_input_3", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.3); root.setWidth(100); root.setHeight(113.4); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(114); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(65); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(24); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(25); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(114); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(65); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(24); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(25); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -728,73 +728,73 @@ it("rounding_fractial_input_3", function () { config.free(); } }); -it("rounding_fractial_input_4", function () { - var config = Yoga.Config.create(); +test("rounding_fractial_input_4", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.7); root.setWidth(100); root.setHeight(113.4); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(50); root_child0.setHeight(20); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(1 === root.getComputedTop(), "1 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(1); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(64); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(24); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(1 === root.getComputedTop(), "1 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(1); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(113); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(64); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(64); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(25); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(89); + expect(root_child2.getComputedWidth()).toBe(100); + expect(root_child2.getComputedHeight()).toBe(24); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -803,86 +803,86 @@ it("rounding_fractial_input_4", function () { config.free(); } }); -it("rounding_inner_node_controversy_horizontal", function () { - var config = Yoga.Config.create(); +test("rounding_inner_node_controversy_horizontal", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(320); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setHeight(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight(10); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setFlexGrow(1); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(320 === root.getComputedWidth(), "320 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(10 === root.getComputedHeight(), "10 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(320); + expect(root.getComputedHeight()).toBe(10); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(107 === root_child0.getComputedWidth(), "107 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(107); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(107 === root_child1.getComputedLeft(), "107 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(106 === root_child1.getComputedWidth(), "106 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(107); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(106); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(106 === root_child1_child0.getComputedWidth(), "106 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(106); + expect(root_child1_child0.getComputedHeight()).toBe(10); - console.assert(213 === root_child2.getComputedLeft(), "213 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(107 === root_child2.getComputedWidth(), "107 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(213); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(107); + expect(root_child2.getComputedHeight()).toBe(10); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(320 === root.getComputedWidth(), "320 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(10 === root.getComputedHeight(), "10 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(320); + expect(root.getComputedHeight()).toBe(10); - console.assert(213 === root_child0.getComputedLeft(), "213 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(107 === root_child0.getComputedWidth(), "107 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(213); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(107); + expect(root_child0.getComputedHeight()).toBe(10); - console.assert(107 === root_child1.getComputedLeft(), "107 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(106 === root_child1.getComputedWidth(), "106 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(107); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(106); + expect(root_child1.getComputedHeight()).toBe(10); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(106 === root_child1_child0.getComputedWidth(), "106 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(106); + expect(root_child1_child0.getComputedHeight()).toBe(10); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(107 === root_child2.getComputedWidth(), "107 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(107); + expect(root_child2.getComputedHeight()).toBe(10); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -891,85 +891,85 @@ it("rounding_inner_node_controversy_horizontal", function () { config.free(); } }); -it("rounding_inner_node_controversy_vertical", function () { - var config = Yoga.Config.create(); +test("rounding_inner_node_controversy_vertical", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setHeight(320); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setWidth(10); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setFlexGrow(1); root_child1_child0.setWidth(10); root_child1.insertChild(root_child1_child0, 0); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setWidth(10); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(10 === root.getComputedWidth(), "10 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(10); + expect(root.getComputedHeight()).toBe(320); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(107 === root_child0.getComputedHeight(), "107 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(107); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(107 === root_child1.getComputedTop(), "107 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(106 === root_child1.getComputedHeight(), "106 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(107); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(106); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(10 === root_child1_child0.getComputedWidth(), "10 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(106 === root_child1_child0.getComputedHeight(), "106 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(10); + expect(root_child1_child0.getComputedHeight()).toBe(106); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(213 === root_child2.getComputedTop(), "213 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(107 === root_child2.getComputedHeight(), "107 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(213); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(107); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(10 === root.getComputedWidth(), "10 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(10); + expect(root.getComputedHeight()).toBe(320); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(107 === root_child0.getComputedHeight(), "107 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(10); + expect(root_child0.getComputedHeight()).toBe(107); - console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(107 === root_child1.getComputedTop(), "107 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(106 === root_child1.getComputedHeight(), "106 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(107); + expect(root_child1.getComputedWidth()).toBe(10); + expect(root_child1.getComputedHeight()).toBe(106); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(10 === root_child1_child0.getComputedWidth(), "10 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(106 === root_child1_child0.getComputedHeight(), "106 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(10); + expect(root_child1_child0.getComputedHeight()).toBe(106); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(213 === root_child2.getComputedTop(), "213 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(107 === root_child2.getComputedHeight(), "107 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(213); + expect(root_child2.getComputedWidth()).toBe(10); + expect(root_child2.getComputedHeight()).toBe(107); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -978,132 +978,132 @@ it("rounding_inner_node_controversy_vertical", function () { config.free(); } }); -it("rounding_inner_node_controversy_combined", function () { - var config = Yoga.Config.create(); +test("rounding_inner_node_controversy_combined", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(640); root.setHeight(320); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setHeight("100%"); root.insertChild(root_child0, 0); - var root_child1 = Yoga.Node.create(config); + const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setHeight("100%"); root.insertChild(root_child1, 1); - var root_child1_child0 = Yoga.Node.create(config); + const root_child1_child0 = Yoga.Node.create(config); root_child1_child0.setFlexGrow(1); root_child1_child0.setWidth("100%"); root_child1.insertChild(root_child1_child0, 0); - var root_child1_child1 = Yoga.Node.create(config); + const root_child1_child1 = Yoga.Node.create(config); root_child1_child1.setFlexGrow(1); root_child1_child1.setWidth("100%"); root_child1.insertChild(root_child1_child1, 1); - var root_child1_child1_child0 = Yoga.Node.create(config); + const root_child1_child1_child0 = Yoga.Node.create(config); root_child1_child1_child0.setFlexGrow(1); root_child1_child1_child0.setWidth("100%"); root_child1_child1.insertChild(root_child1_child1_child0, 0); - var root_child1_child2 = Yoga.Node.create(config); + const root_child1_child2 = Yoga.Node.create(config); root_child1_child2.setFlexGrow(1); root_child1_child2.setWidth("100%"); root_child1.insertChild(root_child1_child2, 2); - var root_child2 = Yoga.Node.create(config); + const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setHeight("100%"); root.insertChild(root_child2, 2); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(640 === root.getComputedWidth(), "640 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(640); + expect(root.getComputedHeight()).toBe(320); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(213 === root_child0.getComputedWidth(), "213 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(320 === root_child0.getComputedHeight(), "320 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(213); + expect(root_child0.getComputedHeight()).toBe(320); - console.assert(213 === root_child1.getComputedLeft(), "213 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(214 === root_child1.getComputedWidth(), "214 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(320 === root_child1.getComputedHeight(), "320 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(213); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(214); + expect(root_child1.getComputedHeight()).toBe(320); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(214 === root_child1_child0.getComputedWidth(), "214 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(107 === root_child1_child0.getComputedHeight(), "107 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(214); + expect(root_child1_child0.getComputedHeight()).toBe(107); - console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(107 === root_child1_child1.getComputedTop(), "107 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(214 === root_child1_child1.getComputedWidth(), "214 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(106 === root_child1_child1.getComputedHeight(), "106 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(0); + expect(root_child1_child1.getComputedTop()).toBe(107); + expect(root_child1_child1.getComputedWidth()).toBe(214); + expect(root_child1_child1.getComputedHeight()).toBe(106); - console.assert(0 === root_child1_child1_child0.getComputedLeft(), "0 === root_child1_child1_child0.getComputedLeft() (" + root_child1_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1_child0.getComputedTop(), "0 === root_child1_child1_child0.getComputedTop() (" + root_child1_child1_child0.getComputedTop() + ")"); - console.assert(214 === root_child1_child1_child0.getComputedWidth(), "214 === root_child1_child1_child0.getComputedWidth() (" + root_child1_child1_child0.getComputedWidth() + ")"); - console.assert(106 === root_child1_child1_child0.getComputedHeight(), "106 === root_child1_child1_child0.getComputedHeight() (" + root_child1_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child1_child0.getComputedWidth()).toBe(214); + expect(root_child1_child1_child0.getComputedHeight()).toBe(106); - console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(213 === root_child1_child2.getComputedTop(), "213 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(214 === root_child1_child2.getComputedWidth(), "214 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(107 === root_child1_child2.getComputedHeight(), "107 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(0); + expect(root_child1_child2.getComputedTop()).toBe(213); + expect(root_child1_child2.getComputedWidth()).toBe(214); + expect(root_child1_child2.getComputedHeight()).toBe(107); - console.assert(427 === root_child2.getComputedLeft(), "427 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(213 === root_child2.getComputedWidth(), "213 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(320 === root_child2.getComputedHeight(), "320 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(427); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(213); + expect(root_child2.getComputedHeight()).toBe(320); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(640 === root.getComputedWidth(), "640 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(640); + expect(root.getComputedHeight()).toBe(320); - console.assert(427 === root_child0.getComputedLeft(), "427 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(213 === root_child0.getComputedWidth(), "213 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(320 === root_child0.getComputedHeight(), "320 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(427); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(213); + expect(root_child0.getComputedHeight()).toBe(320); - console.assert(213 === root_child1.getComputedLeft(), "213 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")"); - console.assert(214 === root_child1.getComputedWidth(), "214 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")"); - console.assert(320 === root_child1.getComputedHeight(), "320 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")"); + expect(root_child1.getComputedLeft()).toBe(213); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(214); + expect(root_child1.getComputedHeight()).toBe(320); - console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")"); - console.assert(214 === root_child1_child0.getComputedWidth(), "214 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")"); - console.assert(107 === root_child1_child0.getComputedHeight(), "107 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child0.getComputedWidth()).toBe(214); + expect(root_child1_child0.getComputedHeight()).toBe(107); - console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")"); - console.assert(107 === root_child1_child1.getComputedTop(), "107 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")"); - console.assert(214 === root_child1_child1.getComputedWidth(), "214 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")"); - console.assert(106 === root_child1_child1.getComputedHeight(), "106 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")"); + expect(root_child1_child1.getComputedLeft()).toBe(0); + expect(root_child1_child1.getComputedTop()).toBe(107); + expect(root_child1_child1.getComputedWidth()).toBe(214); + expect(root_child1_child1.getComputedHeight()).toBe(106); - console.assert(0 === root_child1_child1_child0.getComputedLeft(), "0 === root_child1_child1_child0.getComputedLeft() (" + root_child1_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1_child0.getComputedTop(), "0 === root_child1_child1_child0.getComputedTop() (" + root_child1_child1_child0.getComputedTop() + ")"); - console.assert(214 === root_child1_child1_child0.getComputedWidth(), "214 === root_child1_child1_child0.getComputedWidth() (" + root_child1_child1_child0.getComputedWidth() + ")"); - console.assert(106 === root_child1_child1_child0.getComputedHeight(), "106 === root_child1_child1_child0.getComputedHeight() (" + root_child1_child1_child0.getComputedHeight() + ")"); + expect(root_child1_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child1_child0.getComputedWidth()).toBe(214); + expect(root_child1_child1_child0.getComputedHeight()).toBe(106); - console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")"); - console.assert(213 === root_child1_child2.getComputedTop(), "213 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")"); - console.assert(214 === root_child1_child2.getComputedWidth(), "214 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")"); - console.assert(107 === root_child1_child2.getComputedHeight(), "107 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")"); + expect(root_child1_child2.getComputedLeft()).toBe(0); + expect(root_child1_child2.getComputedTop()).toBe(213); + expect(root_child1_child2.getComputedWidth()).toBe(214); + expect(root_child1_child2.getComputedHeight()).toBe(107); - console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")"); - console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")"); - console.assert(213 === root_child2.getComputedWidth(), "213 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")"); - console.assert(320 === root_child2.getComputedHeight(), "320 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")"); + expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedTop()).toBe(0); + expect(root_child2.getComputedWidth()).toBe(213); + expect(root_child2.getComputedHeight()).toBe(320); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index 99b676a4..bd6e2dc3 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -7,54 +7,54 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -it("nested_overflowing_child", function () { - var config = Yoga.Config.create(); +test("nested_overflowing_child", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(200); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(200); + expect(root_child0_child0.getComputedHeight()).toBe(200); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(-100 === root_child0_child0.getComputedLeft(), "-100 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(-100); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(200); + expect(root_child0_child0.getComputedHeight()).toBe(200); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -63,56 +63,56 @@ it("nested_overflowing_child", function () { config.free(); } }); -it("nested_overflowing_child_in_constraint_parent", function () { - var config = Yoga.Config.create(); +test("nested_overflowing_child_in_constraint_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(200); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(200); + expect(root_child0_child0.getComputedHeight()).toBe(200); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(100); - console.assert(-100 === root_child0_child0.getComputedLeft(), "-100 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(-100); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(200); + expect(root_child0_child0.getComputedHeight()).toBe(200); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -121,55 +121,55 @@ it("nested_overflowing_child_in_constraint_parent", function () { config.free(); } }); -it("parent_wrap_child_size_overflowing_parent", function () { - var config = Yoga.Config.create(); +test("parent_wrap_child_size_overflowing_parent", function () { + const config = Yoga.Config.create(); try { - var root = Yoga.Node.create(config); + const root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); - var root_child0 = Yoga.Node.create(config); + const root_child0 = Yoga.Node.create(config); root_child0.setWidth(100); root.insertChild(root_child0, 0); - var root_child0_child0 = Yoga.Node.create(config); + const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(100); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(200); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")"); - console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")"); - console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")"); - console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")"); + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); - console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")"); - console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0.getComputedHeight(), "200 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(200); - console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")"); - console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")"); - console.assert(200 === root_child0_child0.getComputedHeight(), "200 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")"); + expect(root_child0_child0.getComputedLeft()).toBe(0); + expect(root_child0_child0.getComputedTop()).toBe(0); + expect(root_child0_child0.getComputedWidth()).toBe(100); + expect(root_child0_child0.getComputedHeight()).toBe(200); } finally { if (typeof root !== "undefined") { root.freeRecursive(); -- 2.50.1.windows.1 From 4d17e309d2f688ece06dabde03ba1253af5080ce Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 01:46:20 -0800 Subject: [PATCH 32/47] Add JS Linting --- .github/workflows/validate-js.yml | 38 +- gentest/gentest-javascript.js | 11 +- javascript/.eslintrc.js | 36 + javascript/.prettierignore | 1 + javascript/README.md | 13 + javascript/jest.config.js | 4 +- javascript/jest.setup.js | 8 +- javascript/package.json | 10 +- javascript/src_js/entrypoint/_entryAsync.js | 4 +- javascript/src_js/entrypoint/_entrySync.js | 4 +- javascript/src_js/entrypoint/asmjs-async.js | 2 +- javascript/src_js/entrypoint/asmjs-sync.js | 2 +- javascript/src_js/entrypoint/wasm-async.js | 2 +- javascript/src_js/entrypoint/wasm-sync.js | 2 +- javascript/src_js/index.js | 2 +- javascript/src_js/sync.js | 2 +- javascript/src_js/wrapAsm.js | 86 +-- .../tests/Benchmarks/YGBenchmark.test.js | 8 +- javascript/tests/YGAlignBaselineTest.test.js | 76 +-- javascript/tests/YGComputedBorderTest.test.js | 16 +- javascript/tests/YGComputedMarginTest.test.js | 16 +- .../tests/YGComputedPaddingTest.test.js | 16 +- javascript/tests/YGDirtiedTest.test.js | 140 ++-- javascript/tests/YGMeasureCacheTest.test.js | 10 +- javascript/tests/YGMeasureTest.test.js | 10 +- .../generated/YGAbsolutePositionTest.test.js | 63 +- .../generated/YGAlignContentTest.test.js | 57 +- .../tests/generated/YGAlignItemsTest.test.js | 92 ++- .../tests/generated/YGAlignSelfTest.test.js | 15 +- .../tests/generated/YGAndroidNewsFeed.test.js | 3 +- .../tests/generated/YGBorderTest.test.js | 15 +- .../tests/generated/YGDimensionTest.test.js | 6 +- .../tests/generated/YGDisplayTest.test.js | 18 +- .../generated/YGFlexDirectionTest.test.js | 18 +- javascript/tests/generated/YGFlexTest.test.js | 30 +- .../tests/generated/YGFlexWrapTest.test.js | 60 +- javascript/tests/generated/YGGapTest.test.js | 63 +- .../generated/YGJustifyContentTest.test.js | 54 +- .../tests/generated/YGMarginTest.test.js | 99 ++- .../generated/YGMinMaxDimensionTest.test.js | 72 +- .../tests/generated/YGPaddingTest.test.js | 18 +- .../tests/generated/YGPercentageTest.test.js | 57 +- .../tests/generated/YGRoundingTest.test.js | 39 +- .../generated/YGSizeOverflowTest.test.js | 9 +- javascript/tests/run-bench.js | 16 +- javascript/tests/tools.js | 69 +- javascript/yarn.lock | 616 +++++++++++++++++- 47 files changed, 1447 insertions(+), 561 deletions(-) create mode 100644 javascript/.eslintrc.js create mode 100644 javascript/.prettierignore diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml index 84587a0f..a950d90f 100644 --- a/.github/workflows/validate-js.yml +++ b/.github/workflows/validate-js.yml @@ -8,10 +8,22 @@ on: workflow_dispatch: jobs: - build: - name: Build + Test + benchmark: + name: Benchmark runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup + uses: ./.github/actions/setup-js + + - name: yarn benchmark + run: yarn benchmark + working-directory: javascript + + build: + name: Build + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -22,10 +34,28 @@ jobs: run: yarn build working-directory: javascript + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-js + - name: yarn test run: yarn test working-directory: javascript - - name: yarn benchmark - run: yarn benchmark + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-js + + - name: yarn lint + run: yarn lint working-directory: javascript diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 0c07de34..ebcf7180 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -33,9 +33,10 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitPrologue:{value:function() {}}, emitTestPrologue:{value:function(name, experiments) { - this.push('it(' + JSON.stringify(name) + ', function () {'); + this.push('test(' + JSON.stringify(name) + ', function () {'); this.pushIndent(); this.push('const config = Yoga.Config.create();'); + this.push('let root;'); this.push(''); if (experiments.length > 0) { @@ -50,7 +51,11 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { }}, emitTestTreePrologue:{value:function(nodeName) { - this.push('const ' + nodeName + ' = Yoga.Node.create(config);'); + if (nodeName === 'root') { + this.push(`root = Yoga.Node.create(config);`); + } else { + this.push(`const ${nodeName} = Yoga.Node.create(config);`); + } }}, emitTestEpilogue:{value:function(experiments) { @@ -78,7 +83,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { }}, AssertEQ:{value:function(v0, v1) { - this.push('console.assert(' + v0 + ' === ' + v1 + ', "' + v0 + ' === ' + v1 + ' (" + ' + v1 + ' + ")");'); + this.push(`expect(${v1}).toBe(${v0});`); }}, YGAlignAuto:{value:'Yoga.ALIGN_AUTO'}, diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js new file mode 100644 index 00000000..1c27cf59 --- /dev/null +++ b/javascript/.eslintrc.js @@ -0,0 +1,36 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +module.exports = { + extends: [ + "eslint:recommended", + "plugin:jest/recommended", + "plugin:prettier/recommended", + ], + parser: "@babel/eslint-parser", + env: { + commonjs: true, + es6: true, + }, + ignorePatterns: ["dist/**"], + overrides: [ + { + files: ["jest.*", "tests/**"], + env: { + node: true, + }, + globals: { + getMeasureCounter: "writable", + getMeasureCounterMax: "writable", + getMeasureCounterMin: "writable", + Yoga: "writable", + }, + }, + ], +}; diff --git a/javascript/.prettierignore b/javascript/.prettierignore new file mode 100644 index 00000000..a70ec0e5 --- /dev/null +++ b/javascript/.prettierignore @@ -0,0 +1 @@ +tests/generated/ diff --git a/javascript/README.md b/javascript/README.md index 02c616bb..e103a9d4 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -24,6 +24,19 @@ const node = Yoga.Node.create(); node.setAlignContent(ALIGN_CENTER); ``` +Objects created by `Yoga.<>.create()` are not automatically garbage collected and should be freed once they are no longer in use. + +```ts +// Free a config +config.free(); + +// Free a tree of Nodes +node.freeRecursive(); + +// Free a single Node +node.free(); +``` + ## Selecting WebAssembly or asm.js For better performance and smaller packages, WebAssembly is preferred to asm.js where available. `yoga-layout` tries to provide the right default using [export maps](https://webpack.js.org/guides/package-exports/#conditional-syntax) so that platforms which can take advantage of WebAssembly use it by default. diff --git a/javascript/jest.config.js b/javascript/jest.config.js index 80ef40ac..b1c4e027 100644 --- a/javascript/jest.config.js +++ b/javascript/jest.config.js @@ -9,6 +9,6 @@ module.exports = { setupFiles: ["./jest.setup.js", "./tests/tools.js"], - testRegex: '/tests/.*\\.test\\.js$', + testRegex: "/tests/.*\\.test\\.js$", watchman: false, -} +}; diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index 7b6b5739..9714c39f 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -8,13 +8,13 @@ */ module.exports = async () => { - if (process.env['SYNC'] == true && process.env['WASM'] == true) { + if (process.env["SYNC"] == true && process.env["WASM"] == true) { global.Yoga = require("./dist/entrypoint/wasm-sync"); - } else if (process.env['SYNC'] == true) { + } else if (process.env["SYNC"] == true) { global.Yoga = require("./dist/entrypoint/asmjs-sync"); - } else if (process.env['WASM'] == true) { + } else if (process.env["WASM"] == true) { global.Yoga = await require("./dist/entrypoint/wasm-async").loadYoga(); } else { global.Yoga = await require("./dist/entrypoint/asmjs-async").loadYoga(); } -} +}; diff --git a/javascript/package.json b/javascript/package.json index aa68f1e8..d5a47bf4 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -32,6 +32,8 @@ "build:copy-dts": "cd src_js && find . -name '*.d.ts' | cpio -pdm ../dist", "build:js": "babel src_js --source-maps --out-dir dist && yarn build:copy-dts", "build:native": "yarn build:configure && cmake --build build", + "lint": "eslint .", + "lint:fix": "yarn lint --fix", "test": "yarn test:asmjs-async && yarn test:asmjs-sync && yarn test:wasm-async && yarn test:wasm-sync", "test:asmjs-async": "yarn build --target asmjs-async && WASM=0 SYNC=0 jest", "test:asmjs-sync": "yarn build --target asmjs-sync && WASM=0 SYNC=1 jest", @@ -41,7 +43,13 @@ "devDependencies": { "@babel/cli": "^7.20.7", "@babel/core": "^7.20.7", + "@babel/eslint-parser": "^7.19.1", "@babel/preset-env": "^7.20.2", - "jest": "^29.3.1" + "eslint": "^8.30.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-jest": "^27.1.7", + "eslint-plugin-prettier": "^4.2.1", + "jest": "^29.3.1", + "prettier": "^2.4.1" } } diff --git a/javascript/src_js/entrypoint/_entryAsync.js b/javascript/src_js/entrypoint/_entryAsync.js index 8cb98a65..942296a7 100644 --- a/javascript/src_js/entrypoint/_entryAsync.js +++ b/javascript/src_js/entrypoint/_entryAsync.js @@ -7,9 +7,9 @@ * @format */ -const wrapAsm = require('../wrapAsm'); +const wrapAsm = require("../wrapAsm"); module.exports = (loadAsm) => ({ loadYoga: () => loadAsm().then(wrapAsm), - ...require('../generated/YGEnums'), + ...require("../generated/YGEnums"), }); diff --git a/javascript/src_js/entrypoint/_entrySync.js b/javascript/src_js/entrypoint/_entrySync.js index ae399bbc..42de4bee 100644 --- a/javascript/src_js/entrypoint/_entrySync.js +++ b/javascript/src_js/entrypoint/_entrySync.js @@ -7,5 +7,5 @@ * @format */ - const wrapAsm = require('../wrapAsm'); - module.exports = (asm) => wrapAsm(asm()); +const wrapAsm = require("../wrapAsm"); +module.exports = (asm) => wrapAsm(asm()); diff --git a/javascript/src_js/entrypoint/asmjs-async.js b/javascript/src_js/entrypoint/asmjs-async.js index 7ca8b3e1..dcab5f92 100644 --- a/javascript/src_js/entrypoint/asmjs-async.js +++ b/javascript/src_js/entrypoint/asmjs-async.js @@ -7,5 +7,5 @@ * @format */ -const asm = require('../build/asmjs-async'); +const asm = require("../build/asmjs-async"); module.exports = require("./_entryAsync")(asm); diff --git a/javascript/src_js/entrypoint/asmjs-sync.js b/javascript/src_js/entrypoint/asmjs-sync.js index b9ff595f..ac940b7f 100644 --- a/javascript/src_js/entrypoint/asmjs-sync.js +++ b/javascript/src_js/entrypoint/asmjs-sync.js @@ -7,5 +7,5 @@ * @format */ -const asm = require('../build/asmjs-sync'); +const asm = require("../build/asmjs-sync"); module.exports = require("./_entrySync")(asm); diff --git a/javascript/src_js/entrypoint/wasm-async.js b/javascript/src_js/entrypoint/wasm-async.js index 49d246df..80dc1f5f 100644 --- a/javascript/src_js/entrypoint/wasm-async.js +++ b/javascript/src_js/entrypoint/wasm-async.js @@ -7,5 +7,5 @@ * @format */ -const asm = require('../build/wasm-async'); +const asm = require("../build/wasm-async"); module.exports = require("./_entryAsync")(asm); diff --git a/javascript/src_js/entrypoint/wasm-sync.js b/javascript/src_js/entrypoint/wasm-sync.js index 08621891..e0404a60 100644 --- a/javascript/src_js/entrypoint/wasm-sync.js +++ b/javascript/src_js/entrypoint/wasm-sync.js @@ -7,5 +7,5 @@ * @format */ -const asm = require('../build/wasm-sync'); +const asm = require("../build/wasm-sync"); module.exports = require("./_entrySync")(asm); diff --git a/javascript/src_js/index.js b/javascript/src_js/index.js index 06a348c4..bea46e9b 100644 --- a/javascript/src_js/index.js +++ b/javascript/src_js/index.js @@ -8,4 +8,4 @@ */ // Fallback for when the export map is not followed -module.exports = require('./entrypoint/asmjs-async'); +module.exports = require("./entrypoint/asmjs-async"); diff --git a/javascript/src_js/sync.js b/javascript/src_js/sync.js index 6ac610ef..70fd4660 100644 --- a/javascript/src_js/sync.js +++ b/javascript/src_js/sync.js @@ -8,4 +8,4 @@ */ // Fallback for when the export map is not followed -module.exports = require('./entrypoint/asmjs-sync'); +module.exports = require("./entrypoint/asmjs-sync"); diff --git a/javascript/src_js/wrapAsm.js b/javascript/src_js/wrapAsm.js index f6e52e5b..4112b635 100644 --- a/javascript/src_js/wrapAsm.js +++ b/javascript/src_js/wrapAsm.js @@ -7,28 +7,28 @@ * @format */ -const CONSTANTS = require('./generated/YGEnums'); +const CONSTANTS = require("./generated/YGEnums"); module.exports = (lib) => { function patch(prototype, name, fn) { let original = prototype[name]; - prototype[name] = function(...args) { + prototype[name] = function (...args) { return fn.call(this, original, ...args); }; } for (let fnName of [ - 'setPosition', - 'setMargin', - 'setFlexBasis', - 'setWidth', - 'setHeight', - 'setMinWidth', - 'setMinHeight', - 'setMaxWidth', - 'setMaxHeight', - 'setPadding', + "setPosition", + "setMargin", + "setFlexBasis", + "setWidth", + "setHeight", + "setMinWidth", + "setMinHeight", + "setMaxWidth", + "setMaxHeight", + "setPadding", ]) { let methods = { [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName], @@ -36,22 +36,22 @@ module.exports = (lib) => { [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`], }; - patch(lib.Node.prototype, fnName, function(original, ...args) { + patch(lib.Node.prototype, fnName, function (original, ...args) { // We patch all these functions to add support for the following calls: // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto") let value = args.pop(); let unit, asNumber; - if (value === 'auto') { + if (value === "auto") { unit = CONSTANTS.UNIT_AUTO; asNumber = undefined; - } else if (typeof value === 'object') { + } else if (typeof value === "object") { unit = value.unit; asNumber = value.valueOf(); } else { unit = - typeof value === 'string' && value.endsWith('%') + typeof value === "string" && value.endsWith("%") ? CONSTANTS.UNIT_PERCENT : CONSTANTS.UNIT_POINT; asNumber = parseFloat(value); @@ -62,7 +62,7 @@ module.exports = (lib) => { if (!methods[unit]) throw new Error( - `Failed to execute "${fnName}": Unsupported unit '${value}'`, + `Failed to execute "${fnName}": Unsupported unit '${value}'` ); if (asNumber !== undefined) { @@ -74,68 +74,70 @@ module.exports = (lib) => { } function wrapMeasureFunction(measureFunction) { - return lib.MeasureCallback.implement({ measure: measureFunction }) + return lib.MeasureCallback.implement({ measure: measureFunction }); } - patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) { - original.call(this, wrapMeasureFunction(measureFunc)) - }) + patch(lib.Node.prototype, "setMeasureFunc", function (original, measureFunc) { + original.call(this, wrapMeasureFunction(measureFunc)); + }); function wrapDirtiedFunc(dirtiedFunction) { - return lib.DirtiedCallback.implement({ dirtied: dirtiedFunction }) + return lib.DirtiedCallback.implement({ dirtied: dirtiedFunction }); } - patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) { - original.call(this, wrapDirtiedFunc(dirtiedFunc)) - }) + patch(lib.Node.prototype, "setDirtiedFunc", function (original, dirtiedFunc) { + original.call(this, wrapDirtiedFunc(dirtiedFunc)); + }); - patch(lib.Config.prototype, 'free', function() { + patch(lib.Config.prototype, "free", function () { // Since we handle the memory allocation ourselves (via lib.Config.create), // we also need to handle the deallocation lib.Config.destroy(this); }); - patch(lib.Node, 'create', function(_, config) { + patch(lib.Node, "create", function (_, config) { // We decide the constructor we want to call depending on the parameters return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault(); }); - patch(lib.Node.prototype, 'free', function() { + patch(lib.Node.prototype, "free", function () { // Since we handle the memory allocation ourselves (via lib.Node.create), // we also need to handle the deallocation lib.Node.destroy(this); }); - patch(lib.Node.prototype, 'freeRecursive', function() { + patch(lib.Node.prototype, "freeRecursive", function () { for (let t = 0, T = this.getChildCount(); t < T; ++t) { this.getChild(0).freeRecursive(); } this.free(); }); - patch(lib.Node.prototype, 'setMeasureFunc', function(original, measureFunc) { + patch(lib.Node.prototype, "setMeasureFunc", function (original, measureFunc) { // This patch is just a convenience patch, since it helps write more // idiomatic source code (such as .setMeasureFunc(null)) if (measureFunc) { - return original.call(this, (...args) => - measureFunc(...args), - ); + return original.call(this, (...args) => measureFunc(...args)); } else { return this.unsetMeasureFunc(); } }); - patch(lib.Node.prototype, 'calculateLayout', function( - original, - width = NaN, - height = NaN, - direction = CONSTANTS.DIRECTION_LTR, - ) { - // Just a small patch to add support for the function default parameters - return original.call(this, width, height, direction); - }); + patch( + lib.Node.prototype, + "calculateLayout", + function ( + original, + width = NaN, + height = NaN, + direction = CONSTANTS.DIRECTION_LTR + ) { + // Just a small patch to add support for the function default parameters + return original.call(this, width, height, direction); + } + ); return { Config: lib.Config, diff --git a/javascript/tests/Benchmarks/YGBenchmark.test.js b/javascript/tests/Benchmarks/YGBenchmark.test.js index 0ac24814..01192002 100644 --- a/javascript/tests/Benchmarks/YGBenchmark.test.js +++ b/javascript/tests/Benchmarks/YGBenchmark.test.js @@ -8,7 +8,7 @@ const ITERATIONS = 2000; const YGBENCHMARK = global.YGBENCHMARK ?? global.test; -YGBENCHMARK("Stack with flex", function() { +YGBENCHMARK("Stack with flex", function () { var root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); @@ -26,7 +26,7 @@ YGBENCHMARK("Stack with flex", function() { root.freeRecursive(); }); -YGBENCHMARK("Align stretch in undefined axis", function() { +YGBENCHMARK("Align stretch in undefined axis", function () { var root = Yoga.Node.create(); var measureCounter = getMeasureCounter(Yoga); @@ -42,7 +42,7 @@ YGBENCHMARK("Align stretch in undefined axis", function() { root.freeRecursive(); }); -YGBENCHMARK("Nested flex", function() { +YGBENCHMARK("Nested flex", function () { var root = Yoga.Node.create(); var measureCounter = getMeasureCounter(Yoga); @@ -66,7 +66,7 @@ YGBENCHMARK("Nested flex", function() { root.freeRecursive(); }); -YGBENCHMARK("Huge nested layout", function() { +YGBENCHMARK("Huge nested layout", function () { var root = Yoga.Node.create(); var iterations = Math.pow(ITERATIONS, 1 / 4); diff --git a/javascript/tests/YGAlignBaselineTest.test.js b/javascript/tests/YGAlignBaselineTest.test.js index dd3e8a71..01c09837 100644 --- a/javascript/tests/YGAlignBaselineTest.test.js +++ b/javascript/tests/YGAlignBaselineTest.test.js @@ -5,11 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -it("align_baseline_parent_using_child_in_column_as_reference", function () { +test("align_baseline_parent_using_child_in_column_as_reference", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(1000); root.setHeight(1000); @@ -42,34 +43,17 @@ it("align_baseline_parent_using_child_in_column_as_reference", function () { root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root_child0.getComputedLeft(), - "0 === root_child0.getComputedLeft() (" + - root_child0.getComputedLeft() + ")"); - console.assert(100 === root_child0.getComputedTop(), - "100 === root_child0.getComputedTop() (" + - root_child0.getComputedTop() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(100); - console.assert(500 === root_child1.getComputedLeft(), - "500 === root_child1.getComputedLeft() (" + - root_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1.getComputedTop(), - "0 === root_child1.getComputedTop() (" + - root_child1.getComputedTop() + ")"); + expect(root_child1.getComputedLeft()).toBe(500); + expect(root_child1.getComputedTop()).toBe(0); - console.assert(0 === root_child1_child0.getComputedLeft(), - "0 === root_child1_child0.getComputedLeft() (" + - root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), - "0 === root_child1_child0.getComputedTop() (" + - root_child1_child0.getComputedTop() + ")"); - - console.assert(0 === root_child1_child1.getComputedLeft(), - "0 === root_child1_child1.getComputedLeft() (" + - root_child1_child1.getComputedLeft() + ")"); - console.assert(300 === root_child1_child1.getComputedTop(), - "300 === root_child1_child1.getComputedTop() (" + - root_child1_child1.getComputedTop() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedLeft()).toBe(0); + expect(root_child1_child1.getComputedTop()).toBe(300); } finally { if (typeof root !== "undefined") { root.freeRecursive(); @@ -79,11 +63,12 @@ it("align_baseline_parent_using_child_in_column_as_reference", function () { } }); -it("align_baseline_parent_using_child_in_row_as_reference", function () { +test("align_baseline_parent_using_child_in_row_as_reference", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(1000); root.setHeight(1000); @@ -116,34 +101,17 @@ it("align_baseline_parent_using_child_in_row_as_reference", function () { root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === root_child0.getComputedLeft(), - "0 === root_child0.getComputedLeft() (" + - root_child0.getComputedLeft() + ")"); - console.assert(0 === root_child0.getComputedTop(), - "0 === root_child0.getComputedTop() (" + - root_child0.getComputedTop() + ")"); + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); - console.assert(500 === root_child1.getComputedLeft(), - "500 === root_child1.getComputedLeft() (" + - root_child1.getComputedLeft() + ")"); - console.assert(200 === root_child1.getComputedTop(), - "200 === root_child1.getComputedTop() (" + - root_child1.getComputedTop() + ")"); + expect(root_child1.getComputedLeft()).toBe(500); + expect(root_child1.getComputedTop()).toBe(200); - console.assert(0 === root_child1_child0.getComputedLeft(), - "0 === root_child1_child0.getComputedLeft() (" + - root_child1_child0.getComputedLeft() + ")"); - console.assert(0 === root_child1_child0.getComputedTop(), - "0 === root_child1_child0.getComputedTop() (" + - root_child1_child0.getComputedTop() + ")"); - - console.assert(500 === root_child1_child1.getComputedLeft(), - "500 === root_child1_child1.getComputedLeft() (" + - root_child1_child1.getComputedLeft() + ")"); - console.assert(0 === root_child1_child1.getComputedTop(), - "0 === root_child1_child1.getComputedTop() (" + - root_child1_child1.getComputedTop() + ")"); + expect(root_child1_child0.getComputedLeft()).toBe(0); + expect(root_child1_child0.getComputedTop()).toBe(0); + expect(root_child1_child1.getComputedLeft()).toBe(500); + expect(root_child1_child1.getComputedTop()).toBe(0); } finally { if (typeof root !== "undefined") { root.freeRecursive(); diff --git a/javascript/tests/YGComputedBorderTest.test.js b/javascript/tests/YGComputedBorderTest.test.js index 72dd4c5e..37cb34c1 100644 --- a/javascript/tests/YGComputedBorderTest.test.js +++ b/javascript/tests/YGComputedBorderTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -it("border_start", function () { +test("border_start", function () { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); @@ -13,17 +13,13 @@ it("border_start", function () { root.calculateLayout(100, 100, Yoga.DIRECTION_LTR); - console.assert(10 === root.getComputedBorder(Yoga.EDGE_LEFT), "10 === root.getComputedBorder(Yoga.EDGE_LEFT)"); - console.assert(0 === root.getComputedBorder(Yoga.EDGE_RIGHT), "0 === root.getComputedBorder(Yoga.EDGE_RIGHT)"); + expect(root.getComputedBorder(Yoga.EDGE_LEFT)).toBe(10); + expect(root.getComputedBorder(Yoga.EDGE_RIGHT)).toBe(0); root.calculateLayout(100, 100, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedBorder(Yoga.EDGE_LEFT), "0 === root.getComputedBorder(Yoga.EDGE_LEFT)"); - console.assert(10 === root.getComputedBorder(Yoga.EDGE_RIGHT), "10 === root.getComputedBorder(Yoga.EDGE_RIGHT)"); + expect(root.getComputedBorder(Yoga.EDGE_LEFT)).toBe(0); + expect(root.getComputedBorder(Yoga.EDGE_RIGHT)).toBe(10); - if (typeof root !== "undefined") - root.freeRecursive(); - - (typeof gc !== "undefined") && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); diff --git a/javascript/tests/YGComputedMarginTest.test.js b/javascript/tests/YGComputedMarginTest.test.js index 7df2e981..056c2ed8 100644 --- a/javascript/tests/YGComputedMarginTest.test.js +++ b/javascript/tests/YGComputedMarginTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -it("margin_start", function () { +test("margin_start", function () { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); @@ -13,17 +13,13 @@ it("margin_start", function () { root.calculateLayout(100, 100, Yoga.DIRECTION_LTR); - console.assert(10 === root.getComputedMargin(Yoga.EDGE_LEFT), "10 === root.getComputedMargin(Yoga.EDGE_LEFT)"); - console.assert(0 === root.getComputedMargin(Yoga.EDGE_RIGHT), "0 === root.getComputedMargin(Yoga.EDGE_RIGHT)"); + expect(root.getComputedMargin(Yoga.EDGE_LEFT)).toBe(10); + expect(root.getComputedMargin(Yoga.EDGE_RIGHT)).toBe(0); root.calculateLayout(100, 100, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedMargin(Yoga.EDGE_LEFT), "0 === root.getComputedMargin(Yoga.EDGE_LEFT)"); - console.assert(10 === root.getComputedMargin(Yoga.EDGE_RIGHT), "10 === root.getComputedMargin(Yoga.EDGE_RIGHT)"); + expect(root.getComputedMargin(Yoga.EDGE_LEFT)).toBe(0); + expect(root.getComputedMargin(Yoga.EDGE_RIGHT)).toBe(10); - if (typeof root !== "undefined") - root.freeRecursive(); - - (typeof gc !== "undefined") && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); diff --git a/javascript/tests/YGComputedPaddingTest.test.js b/javascript/tests/YGComputedPaddingTest.test.js index 0adb5061..6292c6a4 100644 --- a/javascript/tests/YGComputedPaddingTest.test.js +++ b/javascript/tests/YGComputedPaddingTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -it("padding_start", function () { +test("padding_start", function () { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); @@ -13,17 +13,13 @@ it("padding_start", function () { root.calculateLayout(100, 100, Yoga.DIRECTION_LTR); - console.assert(10 === root.getComputedPadding(Yoga.EDGE_LEFT), "10 === root.getComputedPadding(Yoga.EDGE_LEFT)"); - console.assert(0 === root.getComputedPadding(Yoga.EDGE_RIGHT), "0 === root.getComputedPadding(Yoga.EDGE_RIGHT)"); + expect(root.getComputedPadding(Yoga.EDGE_LEFT)).toBe(10); + expect(root.getComputedPadding(Yoga.EDGE_RIGHT)).toBe(0); root.calculateLayout(100, 100, Yoga.DIRECTION_RTL); - console.assert(0 === root.getComputedPadding(Yoga.EDGE_LEFT), "0 === root.getComputedPadding(Yoga.EDGE_LEFT)"); - console.assert(10 === root.getComputedPadding(Yoga.EDGE_RIGHT), "10 === root.getComputedPadding(Yoga.EDGE_RIGHT)"); + expect(root.getComputedPadding(Yoga.EDGE_LEFT)).toBe(0); + expect(root.getComputedPadding(Yoga.EDGE_RIGHT)).toBe(10); - if (typeof root !== "undefined") - root.freeRecursive(); - - (typeof gc !== "undefined") && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); diff --git a/javascript/tests/YGDirtiedTest.test.js b/javascript/tests/YGDirtiedTest.test.js index 7f8c6ced..8209ec7f 100644 --- a/javascript/tests/YGDirtiedTest.test.js +++ b/javascript/tests/YGDirtiedTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -it("dirtied", function() { +test("dirtied", function () { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -14,28 +14,26 @@ it("dirtied", function() { root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function() { dirtied++; }); + root.setDirtiedFunc(function () { + dirtied++; + }); // only nodes with a measure function can be marked dirty - root.setMeasureFunc(function() {}); + root.setMeasureFunc(function () {}); - console.assert(0 === dirtied, "0 === dirtied"); + expect(dirtied).toBe(0); // dirtied func MUST be called in case of explicit dirtying. root.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); + expect(dirtied).toBe(1); // dirtied func MUST be called ONCE. root.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); + expect(dirtied).toBe(1); - if (typeof root !== "undefined") - root.freeRecursive(); - - typeof gc !== "undefined" && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); -it("dirtied_propagation", function() { +test("dirtied_propagation", function () { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -45,7 +43,7 @@ it("dirtied_propagation", function() { root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); - root_child0.setMeasureFunc(function() {}); + root_child0.setMeasureFunc(function () {}); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(); @@ -57,91 +55,85 @@ it("dirtied_propagation", function() { root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function() { dirtied++; }); - - console.assert(0 === dirtied, "0 === dirtied"); - - // dirtied func MUST be called for the first time. - root_child0.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); - - // dirtied func must NOT be called for the second time. - root_child0.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); - - if (typeof root !== "undefined") - root.freeRecursive(); - - typeof gc !== "undefined" && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that -}); - -it("dirtied_hierarchy", function() { - const root = Yoga.Node.create(); - root.setAlignItems(Yoga.ALIGN_FLEX_START); - root.setWidth(100); - root.setHeight(100); - - const root_child0 = Yoga.Node.create(); - root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); - root_child0.setWidth(50); - root_child0.setHeight(20); - root_child0.setMeasureFunc(function() {}); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); - root_child1.setWidth(50); - root_child1.setHeight(20); - root_child1.setMeasureFunc(function() {}); - root.insertChild(root_child1, 0); - - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); - - let dirtied = 0; - root_child0.setDirtiedFunc(function() { + root.setDirtiedFunc(function () { dirtied++; }); - console.assert(0 === dirtied, "0 === dirtied"); + expect(dirtied).toBe(0); + + // dirtied func MUST be called for the first time. + root_child0.markDirty(); + expect(dirtied).toBe(1); + + // dirtied func must NOT be called for the second time. + root_child0.markDirty(); + expect(dirtied).toBe(1); + + root.freeRecursive(); +}); + +test("dirtied_hierarchy", function () { + const root = Yoga.Node.create(); + root.setAlignItems(Yoga.ALIGN_FLEX_START); + root.setWidth(100); + root.setHeight(100); + + const root_child0 = Yoga.Node.create(); + root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); + root_child0.setWidth(50); + root_child0.setHeight(20); + root_child0.setMeasureFunc(function () {}); + root.insertChild(root_child0, 0); + + const root_child1 = Yoga.Node.create(); + root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); + root_child1.setWidth(50); + root_child1.setHeight(20); + root_child1.setMeasureFunc(function () {}); + root.insertChild(root_child1, 0); + + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + + let dirtied = 0; + root_child0.setDirtiedFunc(function () { + dirtied++; + }); + + expect(dirtied).toBe(0); // dirtied func must NOT be called for descendants. // NOTE: nodes without a measure function cannot be marked dirty manually, // but nodes with a measure function can not have children. // Update the width to dirty the node instead. root.setWidth(110); - console.assert(0 === dirtied, "0 === dirtied"); + expect(dirtied).toBe(0); // dirtied func MUST be called in case of explicit dirtying. root_child0.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); + expect(dirtied).toBe(1); - if (typeof root !== "undefined") - root.freeRecursive(); - - typeof gc !== "undefined" && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); -it("dirtied_reset", function() { +test("dirtied_reset", function () { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - root.setMeasureFunc(function() {}); + root.setMeasureFunc(function () {}); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function() { + root.setDirtiedFunc(function () { dirtied++; }); - console.assert(0 === dirtied, "0 === dirtied"); + expect(dirtied).toBe(0); // dirtied func MUST be called in case of explicit dirtying. root.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); + expect(dirtied).toBe(1); // recalculate so the root is no longer dirty root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); @@ -150,17 +142,13 @@ it("dirtied_reset", function() { root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - root.setMeasureFunc(function() {}); + root.setMeasureFunc(function () {}); root.markDirty(); // dirtied func must NOT be called after reset. root.markDirty(); - console.assert(1 === dirtied, "1 === dirtied"); + expect(dirtied).toBe(1); - if (typeof root !== "undefined") - root.freeRecursive(); - - typeof gc !== "undefined" && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); diff --git a/javascript/tests/YGMeasureCacheTest.test.js b/javascript/tests/YGMeasureCacheTest.test.js index 07c44a43..7c3f9af1 100644 --- a/javascript/tests/YGMeasureCacheTest.test.js +++ b/javascript/tests/YGMeasureCacheTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -it("measure_once_single_flexible_child", function () { +test("measure_once_single_flexible_child", function () { const root = Yoga.Node.create(); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_START); @@ -21,11 +21,7 @@ it("measure_once_single_flexible_child", function () { root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(1 === measureCounter.get(), "1 === measureCounter.get()"); + expect(measureCounter.get()).toBe(1); - if (typeof root !== "undefined") - root.freeRecursive(); - - (typeof gc !== "undefined") && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); diff --git a/javascript/tests/YGMeasureTest.test.js b/javascript/tests/YGMeasureTest.test.js index 331b5ae5..3aa674f7 100644 --- a/javascript/tests/YGMeasureTest.test.js +++ b/javascript/tests/YGMeasureTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -it("dont_measure_single_grow_shrink_child", function () { +test("dont_measure_single_grow_shrink_child", function () { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); @@ -19,11 +19,7 @@ it("dont_measure_single_grow_shrink_child", function () { root.insertChild(root_child0, 0); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); - console.assert(0 === measureCounter.get(), "0 === measureCounter.get() (" + measureCounter.get() + ")"); + expect(measureCounter.get()).toBe(0); - if (typeof root !== "undefined") - root.freeRecursive(); - - (typeof gc !== "undefined") && gc(); - // TODO Add event support in js and check instace allocation and de allocation using that + root.freeRecursive(); }); diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index fbe4bbdf..be782df6 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -9,9 +9,10 @@ test("absolute_layout_width_height_start_top", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -55,9 +56,10 @@ test("absolute_layout_width_height_start_top", function () { }); test("absolute_layout_width_height_end_bottom", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -101,9 +103,10 @@ test("absolute_layout_width_height_end_bottom", function () { }); test("absolute_layout_start_top_end_bottom", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -147,9 +150,10 @@ test("absolute_layout_start_top_end_bottom", function () { }); test("absolute_layout_width_height_start_top_end_bottom", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -195,9 +199,10 @@ test("absolute_layout_width_height_start_top_end_bottom", function () { }); test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setOverflow(Yoga.OVERFLOW_HIDDEN); root.setWidth(50); @@ -256,9 +261,10 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare }); test("absolute_layout_within_border", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setMargin(Yoga.EDGE_LEFT, 10); root.setMargin(Yoga.EDGE_TOP, 10); root.setMargin(Yoga.EDGE_RIGHT, 10); @@ -376,9 +382,10 @@ test("absolute_layout_within_border", function () { }); test("absolute_layout_align_items_and_justify_content_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); @@ -423,9 +430,10 @@ test("absolute_layout_align_items_and_justify_content_center", function () { }); test("absolute_layout_align_items_and_justify_content_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setFlexGrow(1); @@ -470,9 +478,10 @@ test("absolute_layout_align_items_and_justify_content_flex_end", function () { }); test("absolute_layout_justify_content_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setFlexGrow(1); root.setWidth(110); @@ -516,9 +525,10 @@ test("absolute_layout_justify_content_center", function () { }); test("absolute_layout_align_items_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); root.setWidth(110); @@ -562,9 +572,10 @@ test("absolute_layout_align_items_center", function () { }); test("absolute_layout_align_items_center_on_child_only", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); @@ -608,9 +619,10 @@ test("absolute_layout_align_items_center_on_child_only", function () { }); test("absolute_layout_align_items_and_justify_content_center_and_top_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); @@ -656,9 +668,10 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", }); test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); @@ -704,9 +717,10 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position }); test("absolute_layout_align_items_and_justify_content_center_and_left_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); @@ -752,9 +766,10 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", }); test("absolute_layout_align_items_and_justify_content_center_and_right_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexGrow(1); @@ -800,9 +815,10 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" }); test("position_root_with_rtl_should_position_withoutdirection", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_LEFT, 72); root.setWidth(52); root.setHeight(52); @@ -829,9 +845,10 @@ test("position_root_with_rtl_should_position_withoutdirection", function () { }); test("absolute_layout_percentage_bottom_based_on_parent_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(200); @@ -908,9 +925,10 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", function () { }); test("absolute_layout_in_wrap_reverse_column_container", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); root.setHeight(100); @@ -953,9 +971,10 @@ test("absolute_layout_in_wrap_reverse_column_container", function () { }); test("absolute_layout_in_wrap_reverse_row_container", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); @@ -999,9 +1018,10 @@ test("absolute_layout_in_wrap_reverse_row_container", function () { }); test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); root.setHeight(100); @@ -1045,9 +1065,10 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { }); test("absolute_layout_in_wrap_reverse_row_container_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js index 8e1802c7..4454fd86 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -9,9 +9,10 @@ test("align_content_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(130); @@ -114,9 +115,10 @@ test("align_content_flex_start", function () { }); test("align_content_flex_start_without_height_on_children", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(100); @@ -215,9 +217,10 @@ test("align_content_flex_start_without_height_on_children", function () { }); test("align_content_flex_start_with_flex", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); root.setHeight(120); @@ -322,9 +325,10 @@ test("align_content_flex_start_with_flex", function () { }); test("align_content_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -427,9 +431,10 @@ test("align_content_flex_end", function () { }); test("align_content_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); @@ -527,9 +532,10 @@ test("align_content_stretch", function () { }); test("align_content_spacebetween", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -633,9 +639,10 @@ test("align_content_spacebetween", function () { }); test("align_content_spacearound", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -739,9 +746,10 @@ test("align_content_spacearound", function () { }); test("align_content_stretch_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -840,9 +848,10 @@ test("align_content_stretch_row", function () { }); test("align_content_stretch_row_with_children", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -957,9 +966,10 @@ test("align_content_stretch_row_with_children", function () { }); test("align_content_stretch_row_with_flex", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1064,9 +1074,10 @@ test("align_content_stretch_row_with_flex", function () { }); test("align_content_stretch_row_with_flex_no_shrink", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1170,9 +1181,10 @@ test("align_content_stretch_row_with_flex_no_shrink", function () { }); test("align_content_stretch_row_with_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1279,9 +1291,10 @@ test("align_content_stretch_row_with_margin", function () { }); test("align_content_stretch_row_with_padding", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1388,9 +1401,10 @@ test("align_content_stretch_row_with_padding", function () { }); test("align_content_stretch_row_with_single_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1447,9 +1461,10 @@ test("align_content_stretch_row_with_single_row", function () { }); test("align_content_stretch_row_with_fixed_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1549,9 +1564,10 @@ test("align_content_stretch_row_with_fixed_height", function () { }); test("align_content_stretch_row_with_max_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1651,9 +1667,10 @@ test("align_content_stretch_row_with_max_height", function () { }); test("align_content_stretch_row_with_min_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1753,9 +1770,10 @@ test("align_content_stretch_row_with_min_height", function () { }); test("align_content_stretch_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -1872,9 +1890,10 @@ test("align_content_stretch_column", function () { }); test("align_content_stretch_is_not_overriding_align_items", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); const root_child0 = Yoga.Node.create(config); diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index 02ee9df6..a53702c7 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -9,9 +9,10 @@ test("align_items_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -51,9 +52,10 @@ test("align_items_stretch", function () { }); test("align_items_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(100); root.setHeight(100); @@ -95,9 +97,10 @@ test("align_items_center", function () { }); test("align_items_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); @@ -139,9 +142,10 @@ test("align_items_flex_start", function () { }); test("align_items_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setWidth(100); root.setHeight(100); @@ -183,9 +187,10 @@ test("align_items_flex_end", function () { }); test("align_baseline", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -243,9 +248,10 @@ test("align_baseline", function () { }); test("align_baseline_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -318,9 +324,10 @@ test("align_baseline_child", function () { }); test("align_baseline_child_multiline", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -440,9 +447,10 @@ test("align_baseline_child_multiline", function () { }); test("align_baseline_child_multiline_override", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -564,9 +572,10 @@ test("align_baseline_child_multiline_override", function () { }); test("align_baseline_child_multiline_no_override_on_secondline", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -687,9 +696,10 @@ test("align_baseline_child_multiline_no_override_on_secondline", function () { }); test("align_baseline_child_top", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -763,9 +773,10 @@ test("align_baseline_child_top", function () { }); test("align_baseline_child_top2", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -839,9 +850,10 @@ test("align_baseline_child_top2", function () { }); test("align_baseline_double_nested_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -929,9 +941,10 @@ test("align_baseline_double_nested_child", function () { }); test("align_baseline_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); root.setHeight(100); @@ -988,9 +1001,10 @@ test("align_baseline_column", function () { }); test("align_baseline_child_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setWidth(100); @@ -1071,9 +1085,10 @@ test("align_baseline_child_margin", function () { }); test("align_baseline_child_padding", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setPadding(Yoga.EDGE_LEFT, 5); @@ -1154,9 +1169,10 @@ test("align_baseline_child_padding", function () { }); test("align_baseline_multiline", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1275,9 +1291,10 @@ test("align_baseline_multiline", function () { }); test("align_baseline_multiline_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -1361,7 +1378,7 @@ test("align_baseline_multiline_column", function () { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(70); + expect(root_child1.getComputedLeft()).toBe(50); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1371,7 +1388,7 @@ test("align_baseline_multiline_column", function () { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedLeft()).toBe(0); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1395,9 +1412,10 @@ test("align_baseline_multiline_column", function () { }); test("align_baseline_multiline_column2", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -1481,7 +1499,7 @@ test("align_baseline_multiline_column2", function () { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(70); + expect(root_child1.getComputedLeft()).toBe(50); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1491,7 +1509,7 @@ test("align_baseline_multiline_column2", function () { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedLeft()).toBe(0); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1515,9 +1533,10 @@ test("align_baseline_multiline_column2", function () { }); test("align_baseline_multiline_row_and_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_BASELINE); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1636,9 +1655,10 @@ test("align_baseline_multiline_row_and_column", function () { }); test("align_items_center_child_with_margin_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); @@ -1697,9 +1717,10 @@ test("align_items_center_child_with_margin_bigger_than_parent", function () { }); test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); @@ -1758,9 +1779,10 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { }); test("align_items_center_child_without_margin_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); @@ -1817,9 +1839,10 @@ test("align_items_center_child_without_margin_bigger_than_parent", function () { }); test("align_items_flex_end_child_without_margin_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(52); @@ -1876,9 +1899,10 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", function () }); test("align_center_should_size_based_on_content", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setMargin(Yoga.EDGE_TOP, 20); root.setWidth(100); @@ -1951,9 +1975,10 @@ test("align_center_should_size_based_on_content", function () { }); test("align_stretch_should_size_based_on_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setMargin(Yoga.EDGE_TOP, 20); root.setWidth(100); root.setHeight(100); @@ -2025,9 +2050,10 @@ test("align_stretch_should_size_based_on_parent", function () { }); test("align_flex_start_with_shrinking_children", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); @@ -2097,9 +2123,10 @@ test("align_flex_start_with_shrinking_children", function () { }); test("align_flex_start_with_stretching_children", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); @@ -2168,9 +2195,10 @@ test("align_flex_start_with_stretching_children", function () { }); test("align_flex_start_with_shrinking_children_with_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index da288597..feee7b0f 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -9,9 +9,10 @@ test("align_self_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -53,9 +54,10 @@ test("align_self_center", function () { }); test("align_self_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -97,9 +99,10 @@ test("align_self_flex_end", function () { }); test("align_self_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -141,9 +144,10 @@ test("align_self_flex_start", function () { }); test("align_self_flex_end_override_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); @@ -186,9 +190,10 @@ test("align_self_flex_end_override_flex_start", function () { }); test("align_self_baseline", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index a553a786..3b146bc5 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -9,9 +9,10 @@ test("android_news_feed", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setWidth(1080); diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index 74cf6b54..8d75a2b7 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -9,9 +9,10 @@ test("border_no_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); @@ -39,9 +40,10 @@ test("border_no_size", function () { }); test("border_container_match_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); @@ -84,9 +86,10 @@ test("border_container_match_child", function () { }); test("border_flex_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); @@ -131,9 +134,10 @@ test("border_flex_child", function () { }); test("border_stretch_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setBorder(Yoga.EDGE_LEFT, 10); root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); @@ -177,9 +181,10 @@ test("border_stretch_child", function () { }); test("border_center_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setBorder(Yoga.EDGE_START, 10); diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index edf74109..96638b44 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -9,9 +9,10 @@ test("wrap_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(100); @@ -50,9 +51,10 @@ test("wrap_child", function () { }); test("wrap_grandchild", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index f1d50ff6..3819330d 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -9,9 +9,10 @@ test("display_none", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -67,9 +68,10 @@ test("display_none", function () { }); test("display_none_fixed_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -126,9 +128,10 @@ test("display_none_fixed_size", function () { }); test("display_none_with_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -189,9 +192,10 @@ test("display_none_with_margin", function () { }); test("display_none_with_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -284,9 +288,10 @@ test("display_none_with_child", function () { }); test("display_none_with_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -343,9 +348,10 @@ test("display_none_with_position", function () { }); test("display_none_with_position_absolute", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index 291363d4..70aa6e0c 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -9,9 +9,10 @@ test("flex_direction_column_no_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -78,9 +79,10 @@ test("flex_direction_column_no_height", function () { }); test("flex_direction_row_no_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setHeight(100); @@ -148,9 +150,10 @@ test("flex_direction_row_no_width", function () { }); test("flex_direction_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -218,9 +221,10 @@ test("flex_direction_column", function () { }); test("flex_direction_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -289,9 +293,10 @@ test("flex_direction_row", function () { }); test("flex_direction_column_reverse", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE); root.setWidth(100); root.setHeight(100); @@ -360,9 +365,10 @@ test("flex_direction_column_reverse", function () { }); test("flex_direction_row_reverse", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index c3368ee1..93e997eb 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -9,9 +9,10 @@ test("flex_basis_flex_grow_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -66,9 +67,10 @@ test("flex_basis_flex_grow_column", function () { }); test("flex_shrink_flex_grow_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(500); root.setHeight(500); @@ -127,9 +129,10 @@ test("flex_shrink_flex_grow_row", function () { }); test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(500); root.setHeight(500); @@ -189,9 +192,10 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { }); test("flex_basis_flex_grow_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -247,9 +251,10 @@ test("flex_basis_flex_grow_row", function () { }); test("flex_basis_flex_shrink_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -304,9 +309,10 @@ test("flex_basis_flex_shrink_column", function () { }); test("flex_basis_flex_shrink_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -362,9 +368,10 @@ test("flex_basis_flex_shrink_row", function () { }); test("flex_shrink_to_zero", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setHeight(75); const root_child0 = Yoga.Node.create(config); @@ -435,9 +442,10 @@ test("flex_shrink_to_zero", function () { }); test("flex_basis_overrides_main_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -509,9 +517,10 @@ test("flex_basis_overrides_main_size", function () { }); test("flex_grow_shrink_at_most", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -565,9 +574,10 @@ test("flex_grow_shrink_at_most", function () { }); test("flex_grow_less_than_factor_one", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(500); diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index ba65302e..e670b7ca 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -9,9 +9,10 @@ test("wrap_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexWrap(Yoga.WRAP_WRAP); root.setHeight(100); @@ -97,9 +98,10 @@ test("wrap_column", function () { }); test("wrap_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -186,9 +188,10 @@ test("wrap_row", function () { }); test("wrap_row_align_items_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -276,9 +279,10 @@ test("wrap_row_align_items_flex_end", function () { }); test("wrap_row_align_items_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -366,9 +370,10 @@ test("wrap_row_align_items_center", function () { }); test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -427,9 +432,10 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { }); test("flex_wrap_wrap_to_child_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config); root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); @@ -513,9 +519,10 @@ test("flex_wrap_wrap_to_child_height", function () { }); test("flex_wrap_align_stretch_fits_one_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(150); @@ -571,9 +578,10 @@ test("flex_wrap_align_stretch_fits_one_row", function () { }); test("wrap_reverse_row_align_content_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(100); @@ -675,9 +683,10 @@ test("wrap_reverse_row_align_content_flex_start", function () { }); test("wrap_reverse_row_align_content_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -780,9 +789,10 @@ test("wrap_reverse_row_align_content_center", function () { }); test("wrap_reverse_row_single_line_different_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(300); @@ -884,9 +894,10 @@ test("wrap_reverse_row_single_line_different_size", function () { }); test("wrap_reverse_row_align_content_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -989,9 +1000,10 @@ test("wrap_reverse_row_align_content_stretch", function () { }); test("wrap_reverse_row_align_content_space_around", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); @@ -1094,9 +1106,10 @@ test("wrap_reverse_row_align_content_space_around", function () { }); test("wrap_reverse_column_fixed_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); root.setWidth(200); @@ -1199,9 +1212,10 @@ test("wrap_reverse_column_fixed_size", function () { }); test("wrapped_row_within_align_items_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -1273,9 +1287,10 @@ test("wrapped_row_within_align_items_center", function () { }); test("wrapped_row_within_align_items_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(200); root.setHeight(200); @@ -1347,9 +1362,10 @@ test("wrapped_row_within_align_items_flex_start", function () { }); test("wrapped_row_within_align_items_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setWidth(200); root.setHeight(200); @@ -1421,9 +1437,10 @@ test("wrapped_row_within_align_items_flex_end", function () { }); test("wrapped_column_max_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignContent(Yoga.ALIGN_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1503,9 +1520,10 @@ test("wrapped_column_max_height", function () { }); test("wrapped_column_max_height_flex", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignContent(Yoga.ALIGN_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); @@ -1591,9 +1609,10 @@ test("wrapped_column_max_height_flex", function () { }); test("wrap_nodes_with_content_sizing_overflowing_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); @@ -1692,9 +1711,10 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", function () { }); test("wrap_nodes_with_content_sizing_margin_cross", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(500); root.setHeight(500); diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index 242e317f..96160661 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -9,9 +9,10 @@ test("column_gap_flexible", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); @@ -88,9 +89,10 @@ test("column_gap_flexible", function () { }); test("column_gap_inflexible", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); @@ -160,9 +162,10 @@ test("column_gap_inflexible", function () { }); test("column_gap_mixed_flexible", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); @@ -234,9 +237,10 @@ test("column_gap_mixed_flexible", function () { }); test("column_gap_child_margins", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(80); root.setHeight(100); @@ -318,9 +322,10 @@ test("column_gap_child_margins", function () { }); test("column_row_gap_wrapping", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(80); @@ -484,9 +489,10 @@ test("column_row_gap_wrapping", function () { }); test("column_gap_justify_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -556,9 +562,10 @@ test("column_gap_justify_flex_start", function () { }); test("column_gap_justify_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(100); @@ -629,9 +636,10 @@ test("column_gap_justify_center", function () { }); test("column_gap_justify_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(100); @@ -702,9 +710,10 @@ test("column_gap_justify_flex_end", function () { }); test("column_gap_justify_space_between", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); root.setWidth(100); @@ -775,9 +784,10 @@ test("column_gap_justify_space_between", function () { }); test("column_gap_justify_space_around", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); root.setWidth(100); @@ -848,9 +858,10 @@ test("column_gap_justify_space_around", function () { }); test("column_gap_justify_space_evenly", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); root.setWidth(100); @@ -921,9 +932,10 @@ test("column_gap_justify_space_evenly", function () { }); test("column_gap_wrap_align_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); @@ -1043,9 +1055,10 @@ test("column_gap_wrap_align_flex_start", function () { }); test("column_gap_wrap_align_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_CENTER); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1166,9 +1179,10 @@ test("column_gap_wrap_align_center", function () { }); test("column_gap_wrap_align_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1289,9 +1303,10 @@ test("column_gap_wrap_align_flex_end", function () { }); test("column_gap_wrap_align_space_between", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1412,9 +1427,10 @@ test("column_gap_wrap_align_space_between", function () { }); test("column_gap_wrap_align_space_around", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1535,9 +1551,10 @@ test("column_gap_wrap_align_space_around", function () { }); test("column_gap_wrap_align_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1642,9 +1659,10 @@ test("column_gap_wrap_align_stretch", function () { }); test("row_gap_align_items_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1759,9 +1777,10 @@ test("row_gap_align_items_stretch", function () { }); test("row_gap_align_items_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setFlexWrap(Yoga.WRAP_WRAP); @@ -1876,9 +1895,10 @@ test("row_gap_align_items_end", function () { }); test("row_gap_column_child_margins", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(200); root.setGap(Yoga.GUTTER_ROW, 10); @@ -1959,9 +1979,10 @@ test("row_gap_column_child_margins", function () { }); test("row_gap_row_wrap_child_margins", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setFlexWrap(Yoga.WRAP_WRAP); root.setWidth(100); diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index bb2c9721..bca80053 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -9,9 +9,10 @@ test("justify_content_row_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(102); root.setHeight(102); @@ -80,9 +81,10 @@ test("justify_content_row_flex_start", function () { }); test("justify_content_row_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(102); @@ -152,9 +154,10 @@ test("justify_content_row_flex_end", function () { }); test("justify_content_row_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(102); @@ -224,9 +227,10 @@ test("justify_content_row_center", function () { }); test("justify_content_row_space_between", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); root.setWidth(102); @@ -296,9 +300,10 @@ test("justify_content_row_space_between", function () { }); test("justify_content_row_space_around", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); root.setWidth(102); @@ -368,9 +373,10 @@ test("justify_content_row_space_around", function () { }); test("justify_content_column_flex_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(102); root.setHeight(102); @@ -438,9 +444,10 @@ test("justify_content_column_flex_start", function () { }); test("justify_content_column_flex_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(102); root.setHeight(102); @@ -509,9 +516,10 @@ test("justify_content_column_flex_end", function () { }); test("justify_content_column_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(102); root.setHeight(102); @@ -580,9 +588,10 @@ test("justify_content_column_center", function () { }); test("justify_content_column_space_between", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); root.setWidth(102); root.setHeight(102); @@ -651,9 +660,10 @@ test("justify_content_column_space_between", function () { }); test("justify_content_column_space_around", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); root.setWidth(102); root.setHeight(102); @@ -722,9 +732,10 @@ test("justify_content_column_space_around", function () { }); test("justify_content_row_min_width_and_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_LEFT, 100); @@ -767,9 +778,10 @@ test("justify_content_row_min_width_and_margin", function () { }); test("justify_content_row_max_width_and_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_LEFT, 100); @@ -813,9 +825,10 @@ test("justify_content_row_max_width_and_margin", function () { }); test("justify_content_column_min_height_and_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_TOP, 100); root.setMinHeight(50); @@ -857,9 +870,10 @@ test("justify_content_column_min_height_and_margin", function () { }); test("justify_content_colunn_max_height_and_margin", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMargin(Yoga.EDGE_TOP, 100); root.setHeight(100); @@ -902,9 +916,10 @@ test("justify_content_colunn_max_height_and_margin", function () { }); test("justify_content_column_space_evenly", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); root.setWidth(102); root.setHeight(102); @@ -973,9 +988,10 @@ test("justify_content_column_space_evenly", function () { }); test("justify_content_row_space_evenly", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); root.setWidth(102); @@ -1045,9 +1061,10 @@ test("justify_content_row_space_evenly", function () { }); test("justify_content_min_width_with_padding_child_width_greater_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setWidth(1000); root.setHeight(1584); @@ -1125,9 +1142,10 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", f }); test("justify_content_min_width_with_padding_child_width_lower_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignContent(Yoga.ALIGN_STRETCH); root.setWidth(1080); root.setHeight(1584); diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index 7f5ea2e5..debf3c49 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -9,9 +9,10 @@ test("margin_start", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -53,9 +54,10 @@ test("margin_start", function () { }); test("margin_top", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -96,9 +98,10 @@ test("margin_top", function () { }); test("margin_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(100); @@ -141,9 +144,10 @@ test("margin_end", function () { }); test("margin_bottom", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setWidth(100); root.setHeight(100); @@ -185,9 +189,10 @@ test("margin_bottom", function () { }); test("margin_and_flex_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -230,9 +235,10 @@ test("margin_and_flex_row", function () { }); test("margin_and_flex_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -274,9 +280,10 @@ test("margin_and_flex_column", function () { }); test("margin_and_stretch_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -319,9 +326,10 @@ test("margin_and_stretch_row", function () { }); test("margin_and_stretch_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -363,9 +371,10 @@ test("margin_and_stretch_column", function () { }); test("margin_with_sibling_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -421,9 +430,10 @@ test("margin_with_sibling_row", function () { }); test("margin_with_sibling_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -478,9 +488,10 @@ test("margin_with_sibling_column", function () { }); test("margin_auto_bottom", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -538,9 +549,10 @@ test("margin_auto_bottom", function () { }); test("margin_auto_top", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -598,9 +610,10 @@ test("margin_auto_top", function () { }); test("margin_auto_bottom_and_top", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -659,9 +672,10 @@ test("margin_auto_bottom_and_top", function () { }); test("margin_auto_bottom_and_top_justify_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(200); root.setHeight(200); @@ -720,9 +734,10 @@ test("margin_auto_bottom_and_top_justify_center", function () { }); test("margin_auto_mutiple_children_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -796,9 +811,10 @@ test("margin_auto_mutiple_children_column", function () { }); test("margin_auto_mutiple_children_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); @@ -873,9 +889,10 @@ test("margin_auto_mutiple_children_row", function () { }); test("margin_auto_left_and_right_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); @@ -935,9 +952,10 @@ test("margin_auto_left_and_right_column", function () { }); test("margin_auto_left_and_right", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -995,9 +1013,10 @@ test("margin_auto_left_and_right", function () { }); test("margin_auto_start_and_end_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); @@ -1057,9 +1076,10 @@ test("margin_auto_start_and_end_column", function () { }); test("margin_auto_start_and_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -1117,9 +1137,10 @@ test("margin_auto_start_and_end", function () { }); test("margin_auto_left_and_right_column_and_center", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -1178,9 +1199,10 @@ test("margin_auto_left_and_right_column_and_center", function () { }); test("margin_auto_left", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -1238,9 +1260,10 @@ test("margin_auto_left", function () { }); test("margin_auto_right", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -1298,9 +1321,10 @@ test("margin_auto_right", function () { }); test("margin_auto_left_and_right_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); @@ -1359,9 +1383,10 @@ test("margin_auto_left_and_right_stretch", function () { }); test("margin_auto_top_and_bottom_stretch", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -1419,9 +1444,10 @@ test("margin_auto_top_and_bottom_stretch", function () { }); test("margin_should_not_be_part_of_max_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(250); root.setHeight(250); @@ -1464,9 +1490,10 @@ test("margin_should_not_be_part_of_max_height", function () { }); test("margin_should_not_be_part_of_max_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(250); root.setHeight(250); @@ -1509,9 +1536,10 @@ test("margin_should_not_be_part_of_max_width", function () { }); test("margin_auto_left_right_child_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); @@ -1555,9 +1583,10 @@ test("margin_auto_left_right_child_bigger_than_parent", function () { }); test("margin_auto_left_child_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); @@ -1600,9 +1629,10 @@ test("margin_auto_left_child_bigger_than_parent", function () { }); test("margin_fix_left_auto_right_child_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); @@ -1646,9 +1676,10 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", function () { }); test("margin_auto_left_fix_right_child_bigger_than_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(52); root.setHeight(52); @@ -1692,9 +1723,10 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", function () { }); test("margin_auto_top_stretching_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); @@ -1753,9 +1785,10 @@ test("margin_auto_top_stretching_child", function () { }); test("margin_auto_left_stretching_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); root.setHeight(200); diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index da80ff59..f2c63f30 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -9,9 +9,10 @@ test("max_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -52,9 +53,10 @@ test("max_width", function () { }); test("max_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -96,9 +98,10 @@ test("max_height", function () { }); test("justify_content_min_max", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setWidth(100); root.setMinHeight(100); @@ -141,9 +144,10 @@ test("justify_content_min_max", function () { }); test("align_items_min_max", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_CENTER); root.setMinWidth(100); root.setMaxWidth(200); @@ -186,9 +190,10 @@ test("align_items_min_max", function () { }); test("justify_content_overflow_min_max", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setMinHeight(100); root.setMaxHeight(110); @@ -260,9 +265,10 @@ test("justify_content_overflow_min_max", function () { }); test("flex_grow_to_min", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(500); @@ -318,9 +324,10 @@ test("flex_grow_to_min", function () { }); test("flex_grow_in_at_most_container", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -377,9 +384,10 @@ test("flex_grow_in_at_most_container", function () { }); test("flex_grow_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); const root_child0 = Yoga.Node.create(config); @@ -420,9 +428,10 @@ test("flex_grow_child", function () { }); test("flex_grow_within_constrained_min_max_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setMinHeight(100); root.setMaxHeight(200); @@ -476,9 +485,10 @@ test("flex_grow_within_constrained_min_max_column", function () { }); test("flex_grow_within_max_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); @@ -534,9 +544,10 @@ test("flex_grow_within_max_width", function () { }); test("flex_grow_within_constrained_max_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); @@ -592,9 +603,10 @@ test("flex_grow_within_constrained_max_width", function () { }); test("flex_root_ignored", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexGrow(1); root.setWidth(100); root.setMinHeight(100); @@ -651,9 +663,10 @@ test("flex_root_ignored", function () { }); test("flex_grow_root_minimized", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(500); @@ -725,9 +738,10 @@ test("flex_grow_root_minimized", function () { }); test("flex_grow_height_maximized", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(500); @@ -798,9 +812,10 @@ test("flex_grow_height_maximized", function () { }); test("flex_grow_within_constrained_min_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setMinWidth(100); root.setHeight(100); @@ -855,9 +870,10 @@ test("flex_grow_within_constrained_min_row", function () { }); test("flex_grow_within_constrained_min_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setMinHeight(100); const root_child0 = Yoga.Node.create(config); @@ -910,9 +926,10 @@ test("flex_grow_within_constrained_min_column", function () { }); test("flex_grow_within_constrained_max_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); const root_child0 = Yoga.Node.create(config); @@ -982,9 +999,10 @@ test("flex_grow_within_constrained_max_row", function () { }); test("flex_grow_within_constrained_max_column", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setMaxHeight(100); @@ -1039,9 +1057,10 @@ test("flex_grow_within_constrained_max_column", function () { }); test("child_min_max_width_flexing", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(120); root.setHeight(50); @@ -1100,9 +1119,10 @@ test("child_min_max_width_flexing", function () { }); test("min_width_overrides_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(50); root.setMinWidth(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); @@ -1128,9 +1148,10 @@ test("min_width_overrides_width", function () { }); test("max_width_overrides_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setMaxWidth(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); @@ -1156,9 +1177,10 @@ test("max_width_overrides_width", function () { }); test("min_height_overrides_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setHeight(50); root.setMinHeight(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); @@ -1184,9 +1206,10 @@ test("min_height_overrides_height", function () { }); test("max_height_overrides_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setHeight(200); root.setMaxHeight(100); root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); @@ -1212,9 +1235,10 @@ test("max_height_overrides_height", function () { }); test("min_max_percent_no_width_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index b6257fc8..8e2df73e 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -9,9 +9,10 @@ test("padding_no_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); @@ -39,9 +40,10 @@ test("padding_no_size", function () { }); test("padding_container_match_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); @@ -84,9 +86,10 @@ test("padding_container_match_child", function () { }); test("padding_flex_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); @@ -131,9 +134,10 @@ test("padding_flex_child", function () { }); test("padding_stretch_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPadding(Yoga.EDGE_LEFT, 10); root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); @@ -177,9 +181,10 @@ test("padding_stretch_child", function () { }); test("padding_center_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setPadding(Yoga.EDGE_START, 10); @@ -225,9 +230,10 @@ test("padding_center_child", function () { }); test("child_with_padding_align_end", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); root.setAlignItems(Yoga.ALIGN_FLEX_END); root.setWidth(200); diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index 3f39ee6c..def08b5a 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -9,9 +9,10 @@ test("percentage_width_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); @@ -53,9 +54,10 @@ test("percentage_width_height", function () { }); test("percentage_position_left_top", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(400); root.setHeight(400); @@ -99,9 +101,10 @@ test("percentage_position_left_top", function () { }); test("percentage_position_bottom_right", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(500); root.setHeight(500); @@ -145,9 +148,10 @@ test("percentage_position_bottom_right", function () { }); test("percentage_flex_basis", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); @@ -204,9 +208,10 @@ test("percentage_flex_basis", function () { }); test("percentage_flex_basis_cross", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -262,9 +267,10 @@ test("percentage_flex_basis_cross", function () { }); test("percentage_flex_basis_main_max_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); @@ -323,9 +329,10 @@ test("percentage_flex_basis_main_max_height", function () { }); test("percentage_flex_basis_cross_max_height", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -383,9 +390,10 @@ test("percentage_flex_basis_cross_max_height", function () { }); test("percentage_flex_basis_main_max_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); @@ -444,9 +452,10 @@ test("percentage_flex_basis_main_max_width", function () { }); test("percentage_flex_basis_cross_max_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -504,9 +513,10 @@ test("percentage_flex_basis_cross_max_width", function () { }); test("percentage_flex_basis_main_min_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(200); root.setHeight(200); @@ -565,9 +575,10 @@ test("percentage_flex_basis_main_min_width", function () { }); test("percentage_flex_basis_cross_min_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -625,9 +636,10 @@ test("percentage_flex_basis_cross_min_width", function () { }); test("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(200); @@ -737,9 +749,10 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", fun }); test("percentage_margin_should_calculate_based_only_on_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); @@ -798,9 +811,10 @@ test("percentage_margin_should_calculate_based_only_on_width", function () { }); test("percentage_padding_should_calculate_based_only_on_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); @@ -859,9 +873,10 @@ test("percentage_padding_should_calculate_based_only_on_width", function () { }); test("percentage_absolute_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(200); root.setHeight(100); @@ -905,9 +920,10 @@ test("percentage_absolute_position", function () { }); test("percentage_width_height_undefined_parent_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config); root_child0.setWidth("50%"); @@ -946,9 +962,10 @@ test("percentage_width_height_undefined_parent_size", function () { }); test("percent_within_flex_grow", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(350); root.setHeight(100); @@ -1031,9 +1048,10 @@ test("percent_within_flex_grow", function () { }); test("percentage_container_in_wrapping_container", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setJustifyContent(Yoga.JUSTIFY_CENTER); root.setAlignItems(Yoga.ALIGN_CENTER); root.setWidth(200); @@ -1120,9 +1138,10 @@ test("percentage_container_in_wrapping_container", function () { }); test("percent_absolute_position", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(60); root.setHeight(50); diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index 8e05cf1d..52937ca8 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -9,9 +9,10 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(100); root.setHeight(100); @@ -80,9 +81,10 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", function () { }); test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(113); root.setHeight(100); @@ -179,9 +181,10 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { }); test("rounding_flex_basis_flex_shrink_row", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(101); root.setHeight(100); @@ -251,9 +254,10 @@ test("rounding_flex_basis_flex_shrink_row", function () { }); test("rounding_flex_basis_overrides_main_size", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(113); @@ -325,9 +329,10 @@ test("rounding_flex_basis_overrides_main_size", function () { }); test("rounding_total_fractial", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(87.4); root.setHeight(113.4); @@ -399,9 +404,10 @@ test("rounding_total_fractial", function () { }); test("rounding_total_fractial_nested", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(87.4); root.setHeight(113.4); @@ -507,9 +513,10 @@ test("rounding_total_fractial_nested", function () { }); test("rounding_fractial_input_1", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(113.4); @@ -581,9 +588,10 @@ test("rounding_fractial_input_1", function () { }); test("rounding_fractial_input_2", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(113.6); @@ -655,9 +663,10 @@ test("rounding_fractial_input_2", function () { }); test("rounding_fractial_input_3", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.3); root.setWidth(100); root.setHeight(113.4); @@ -730,9 +739,10 @@ test("rounding_fractial_input_3", function () { }); test("rounding_fractial_input_4", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setPosition(Yoga.EDGE_TOP, 0.7); root.setWidth(100); root.setHeight(113.4); @@ -805,9 +815,10 @@ test("rounding_fractial_input_4", function () { }); test("rounding_inner_node_controversy_horizontal", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(320); @@ -893,9 +904,10 @@ test("rounding_inner_node_controversy_horizontal", function () { }); test("rounding_inner_node_controversy_vertical", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setHeight(320); const root_child0 = Yoga.Node.create(config); @@ -980,9 +992,10 @@ test("rounding_inner_node_controversy_vertical", function () { }); test("rounding_inner_node_controversy_combined", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(640); root.setHeight(320); diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index bd6e2dc3..69df93f4 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -9,9 +9,10 @@ test("nested_overflowing_child", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -65,9 +66,10 @@ test("nested_overflowing_child", function () { }); test("nested_overflowing_child_in_constraint_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); @@ -123,9 +125,10 @@ test("nested_overflowing_child_in_constraint_parent", function () { }); test("parent_wrap_child_size_overflowing_parent", function () { const config = Yoga.Config.create(); + let root; try { - const root = Yoga.Node.create(config); + root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index 467724a2..7263c833 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -16,19 +16,21 @@ let vm = require(`vm`); let WARMUP_ITERATIONS = 3; let BENCHMARK_ITERATIONS = 10; -let testFiles = process.argv.slice(2).map(file => { +let testFiles = process.argv.slice(2).map((file) => { return fs.readFileSync(file).toString(); }); let testResults = new Map(); -for (let type of ['asmjs', 'wasm']) { +for (let type of ["asmjs", "wasm"]) { for (let file of testFiles) { vm.runInNewContext( file, Object.assign(Object.create(global), { - Yoga: require(type === 'asmjs' ? '../dist/entrypoint/asmjs-sync' : '../dist/entrypoint/wasm-sync'), - YGBENCHMARK: function(name, fn) { + Yoga: require(type === "asmjs" + ? "../dist/entrypoint/asmjs-sync" + : "../dist/entrypoint/wasm-sync"), + YGBENCHMARK: function (name, fn) { let testEntry = testResults.get(name); if (testEntry === undefined) @@ -44,13 +46,13 @@ for (let type of ['asmjs', 'wasm']) { testEntry.set(type, (end - start) / BENCHMARK_ITERATIONS); }, - }), + }) ); } } console.log( - `Note: those tests are independants; there is no time relation to be expected between them`, + `Note: those tests are independants; there is no time relation to be expected between them` ); for (let [name, results] of testResults) { @@ -62,7 +64,7 @@ for (let [name, results] of testResults) { for (let [type, result] of results) { console.log( - ` - ${type}: ${result}ms (${Math.round((result / min) * 10000) / 100}%)`, + ` - ${type}: ${result}ms (${Math.round((result / min) * 10000) / 100}%)` ); } } diff --git a/javascript/tests/tools.js b/javascript/tests/tools.js index ac18e450..b3820792 100644 --- a/javascript/tests/tools.js +++ b/javascript/tests/tools.js @@ -7,59 +7,54 @@ * @format */ -var target = typeof global !== 'undefined' ? global : window; - -target.getMeasureCounter = function(Yoga, cb, staticWidth, staticHeight) { +global.getMeasureCounter = function (Yoga, cb, staticWidth, staticHeight) { var counter = 0; return { - inc: function(width, widthMode, height, heightMode) { + inc: function (width, widthMode, height, heightMode) { counter += 1; return cb ? cb(width, widthMode, height, heightMode) - : {width: staticWidth, height: staticHeight}; + : { width: staticWidth, height: staticHeight }; }, - get: function() { + get: function () { return counter; }, }; }; -target.getMeasureCounterMax = function(Yoga) { - return getMeasureCounter(Yoga, function( - width, - widthMode, - height, - heightMode, - ) { - var measuredWidth = widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; +global.getMeasureCounterMax = function (Yoga) { + return getMeasureCounter( + Yoga, + function (width, widthMode, height, heightMode) { + var measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; + var measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; - return {width: measuredWidth, height: measuredHeight}; - }); + return { width: measuredWidth, height: measuredHeight }; + } + ); }; -target.getMeasureCounterMin = function(Yoga) { - return getMeasureCounter(Yoga, function( - width, - widthMode, - height, - heightMode, - ) { - var measuredWidth = - widthMode === Yoga.MEASURE_MODE_UNDEFINED || - (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) - ? 10 - : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED || - (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) - ? 10 - : height; +global.getMeasureCounterMin = function (Yoga) { + return getMeasureCounter( + Yoga, + function (width, widthMode, height, heightMode) { + var measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED || + (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) + ? 10 + : width; + var measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED || + (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) + ? 10 + : height; - return {width: measuredWidth, height: measuredHeight}; - }); + return { width: measuredWidth, height: measuredHeight }; + } + ); }; diff --git a/javascript/yarn.lock b/javascript/yarn.lock index 9f02eac8..86066377 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -59,6 +59,15 @@ json5 "^2.2.1" semver "^6.3.0" +"@babel/eslint-parser@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4" + integrity sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ== + dependencies: + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + "@babel/generator@^7.20.7", "@babel/generator@^7.7.2": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" @@ -952,6 +961,40 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@eslint/eslintrc@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.0.tgz#8ec64e0df3e7a1971ee1ff5158da87389f167a63" + integrity sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1205,6 +1248,34 @@ resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" integrity sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ== +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@sinclair/typebox@^0.24.1": version "0.24.51" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" @@ -1283,6 +1354,11 @@ dependencies: "@types/istanbul-lib-report" "*" +"@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + "@types/node@*": version "18.11.17" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.17.tgz#5c009e1d9c38f4a2a9d45c0b0c493fe6cdb4bcb5" @@ -1293,6 +1369,11 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" @@ -1310,6 +1391,74 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/scope-manager@5.47.0": + version "5.47.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.47.0.tgz#f58144a6b0ff58b996f92172c488813aee9b09df" + integrity sha512-dvJab4bFf7JVvjPuh3sfBUWsiD73aiftKBpWSfi3sUkysDQ4W8x+ZcFpNp7Kgv0weldhpmMOZBjx1wKN8uWvAw== + dependencies: + "@typescript-eslint/types" "5.47.0" + "@typescript-eslint/visitor-keys" "5.47.0" + +"@typescript-eslint/types@5.47.0": + version "5.47.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.47.0.tgz#67490def406eaa023dbbd8da42ee0d0c9b5229d3" + integrity sha512-eslFG0Qy8wpGzDdYKu58CEr3WLkjwC5Usa6XbuV89ce/yN5RITLe1O8e+WFEuxnfftHiJImkkOBADj58ahRxSg== + +"@typescript-eslint/typescript-estree@5.47.0": + version "5.47.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.47.0.tgz#ed971a11c5c928646d6ba7fc9dfdd6e997649aca" + integrity sha512-LxfKCG4bsRGq60Sqqu+34QT5qT2TEAHvSCCJ321uBWywgE2dS0LKcu5u+3sMGo+Vy9UmLOhdTw5JHzePV/1y4Q== + dependencies: + "@typescript-eslint/types" "5.47.0" + "@typescript-eslint/visitor-keys" "5.47.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@^5.10.0": + version "5.47.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.47.0.tgz#b5005f7d2696769a1fdc1e00897005a25b3a0ec7" + integrity sha512-U9xcc0N7xINrCdGVPwABjbAKqx4GK67xuMV87toI+HUqgXj26m6RBp9UshEXcTrgCkdGYFzgKLt8kxu49RilDw== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.47.0" + "@typescript-eslint/types" "5.47.0" + "@typescript-eslint/typescript-estree" "5.47.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + semver "^7.3.7" + +"@typescript-eslint/visitor-keys@5.47.0": + version "5.47.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.47.0.tgz#4aca4efbdf6209c154df1f7599852d571b80bb45" + integrity sha512-ByPi5iMa6QqDXe/GmT/hR6MZtVPi0SqMQPDx15FczCBXJo/7M8T88xReOALAfpBLm+zxpPfmhuEvPb577JRAEg== + dependencies: + "@typescript-eslint/types" "5.47.0" + eslint-visitor-keys "^3.3.0" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -1364,6 +1513,16 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + babel-jest@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" @@ -1632,7 +1791,7 @@ core-js-compat@^3.25.1: dependencies: browserslist "^4.21.4" -cross-spawn@^7.0.3: +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1641,7 +1800,7 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1653,6 +1812,11 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" @@ -1668,6 +1832,20 @@ diff-sequences@^29.3.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + electron-to-chromium@^1.4.251: version "1.4.284" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" @@ -1705,11 +1883,146 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" + integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== + +eslint-plugin-jest@^27.1.7: + version "27.1.7" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.1.7.tgz#0351e904afb8d66b7f70452929556dfdc8daba0d" + integrity sha512-0QVzf+og4YI1Qr3UoprkqqhezAZjFffdi62b0IurkCXMqPtRW84/UT4CKsYT80h/D82LA9avjO/80Ou1LdgbaQ== + dependencies: + "@typescript-eslint/utils" "^5.10.0" + +eslint-plugin-prettier@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-scope@5.1.1, eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@^8.30.0: + version "8.30.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.30.0.tgz#83a506125d089eef7c5b5910eeea824273a33f50" + integrity sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ== + dependencies: + "@eslint/eslintrc" "^1.4.0" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.4.0: + version "9.4.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" + integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -1746,11 +2059,44 @@ expect@^29.3.1: jest-message-util "^29.3.1" jest-util "^29.3.1" -fast-json-stable-stringify@^2.1.0: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.14.0.tgz#107f69d7295b11e0fccc264e1fc6389f623731ce" + integrity sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg== + dependencies: + reusify "^1.0.4" + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -1758,6 +2104,13 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -1773,6 +2126,27 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -1813,13 +2187,20 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@~5.1.2: +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -1837,11 +2218,35 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^13.19.0: + version "13.19.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" + integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== + dependencies: + type-fest "^0.20.2" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1869,6 +2274,19 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-local@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" @@ -1929,7 +2347,7 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -1941,6 +2359,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -2354,6 +2777,11 @@ jest@^29.3.1: import-local "^3.0.2" jest-cli "^29.3.1" +js-sdsl@^4.1.4: + version "4.2.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" + integrity sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -2367,6 +2795,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -2382,6 +2817,16 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + json5@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" @@ -2397,6 +2842,14 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -2409,11 +2862,23 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -2455,6 +2920,11 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -2468,7 +2938,7 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2521,6 +2991,18 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -2528,7 +3010,7 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.1.0: +p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -2542,11 +3024,25 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" @@ -2577,6 +3073,11 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -2604,6 +3105,23 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^2.4.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" + integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== + pretty-format@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" @@ -2621,6 +3139,16 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + react-is@^18.0.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" @@ -2657,6 +3185,11 @@ regenerator-transform@^0.15.1: dependencies: "@babel/runtime" "^7.8.4" +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + regexpu-core@^5.2.1: version "5.2.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" @@ -2693,6 +3226,11 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-from@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" @@ -2712,6 +3250,25 @@ resolve@^1.14.2, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -2722,7 +3279,7 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.5: +semver@^7.3.5, semver@^7.3.7: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== @@ -2820,7 +3377,7 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-json-comments@^3.1.1: +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -2860,6 +3417,11 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -2877,11 +3439,35 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + type-detect@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" @@ -2918,6 +3504,13 @@ update-browserslist-db@^1.0.9: escalade "^3.1.1" picocolors "^1.0.0" +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + v8-to-istanbul@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" @@ -2941,6 +3534,11 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" -- 2.50.1.windows.1 From bf81d8e1806a1ccb4ea4c5f29bc83c3710fcb409 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 02:17:10 -0800 Subject: [PATCH 33/47] modernize JS --- gentest/gentest-javascript.js | 2 +- javascript/.eslintrc.js | 12 +++- javascript/CMakeLists.txt | 12 ++-- javascript/src_js/wrapAsm.js | 10 +-- .../tests/Benchmarks/YGBenchmark.test.js | 56 ++++++++-------- javascript/tests/YGAlignBaselineTest.test.js | 4 +- javascript/tests/YGComputedBorderTest.test.js | 2 +- javascript/tests/YGComputedMarginTest.test.js | 2 +- .../tests/YGComputedPaddingTest.test.js | 2 +- javascript/tests/YGDirtiedTest.test.js | 28 ++++---- javascript/tests/YGMeasureCacheTest.test.js | 2 +- javascript/tests/YGMeasureTest.test.js | 2 +- .../generated/YGAbsolutePositionTest.test.js | 42 ++++++------ .../generated/YGAlignContentTest.test.js | 38 +++++------ .../tests/generated/YGAlignItemsTest.test.js | 64 +++++++++--------- .../tests/generated/YGAlignSelfTest.test.js | 10 +-- .../tests/generated/YGAndroidNewsFeed.test.js | 2 +- .../tests/generated/YGBorderTest.test.js | 10 +-- .../tests/generated/YGDimensionTest.test.js | 4 +- .../tests/generated/YGDisplayTest.test.js | 12 ++-- .../generated/YGFlexDirectionTest.test.js | 12 ++-- javascript/tests/generated/YGFlexTest.test.js | 20 +++--- .../tests/generated/YGFlexWrapTest.test.js | 40 +++++------ javascript/tests/generated/YGGapTest.test.js | 46 ++++++------- .../generated/YGJustifyContentTest.test.js | 36 +++++----- .../tests/generated/YGMarginTest.test.js | 66 +++++++++---------- .../generated/YGMinMaxDimensionTest.test.js | 48 +++++++------- .../tests/generated/YGPaddingTest.test.js | 12 ++-- .../tests/generated/YGPercentageTest.test.js | 38 +++++------ .../tests/generated/YGRoundingTest.test.js | 26 ++++---- .../generated/YGSizeOverflowTest.test.js | 6 +- javascript/tests/run-bench.js | 26 ++++---- javascript/tests/tools.js | 48 ++++++-------- 33 files changed, 371 insertions(+), 369 deletions(-) diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index ebcf7180..2b005aad 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -33,7 +33,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitPrologue:{value:function() {}}, emitTestPrologue:{value:function(name, experiments) { - this.push('test(' + JSON.stringify(name) + ', function () {'); + this.push('test(' + JSON.stringify(name) + ', () => {'); this.pushIndent(); this.push('const config = Yoga.Config.create();'); this.push('let root;'); diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js index 1c27cf59..9a11938b 100644 --- a/javascript/.eslintrc.js +++ b/javascript/.eslintrc.js @@ -8,17 +8,25 @@ */ module.exports = { + ignorePatterns: ["dist/**"], + parser: "@babel/eslint-parser", extends: [ "eslint:recommended", "plugin:jest/recommended", "plugin:prettier/recommended", ], - parser: "@babel/eslint-parser", + rules: { + "no-var": "error", + "prefer-arrow-callback": "error", + "prefer-const": "error", + "prefer-object-spread": "error", + "prefer-spread": "error", + "require-await": "error", + }, env: { commonjs: true, es6: true, }, - ignorePatterns: ["dist/**"], overrides: [ { files: ["jest.*", "tests/**"], diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index 00757fad..08e8ba34 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -16,7 +16,10 @@ include_directories(..) set(CXX_STANDARD, 11) -set(EMCC_FLAGS +add_compile_definitions( + EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0) + +set(COMPILE_OPTIONS -flto -fno-exceptions -fno-rtti @@ -24,13 +27,10 @@ set(EMCC_FLAGS -Os "SHELL:-s STRICT=1") -add_compile_options( - ${EMCC_FLAGS} - -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 - -std=c++11) +add_compile_options(${COMPILE_OPTIONS}) add_link_options( - ${EMCC_FLAGS} + ${COMPILE_OPTIONS} --closure 1 --memory-init-file 0 --no-entry diff --git a/javascript/src_js/wrapAsm.js b/javascript/src_js/wrapAsm.js index 4112b635..3c03269f 100644 --- a/javascript/src_js/wrapAsm.js +++ b/javascript/src_js/wrapAsm.js @@ -11,14 +11,14 @@ const CONSTANTS = require("./generated/YGEnums"); module.exports = (lib) => { function patch(prototype, name, fn) { - let original = prototype[name]; + const original = prototype[name]; prototype[name] = function (...args) { return fn.call(this, original, ...args); }; } - for (let fnName of [ + for (const fnName of [ "setPosition", "setMargin", "setFlexBasis", @@ -30,7 +30,7 @@ module.exports = (lib) => { "setMaxHeight", "setPadding", ]) { - let methods = { + const methods = { [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName], [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`], [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`], @@ -40,7 +40,7 @@ module.exports = (lib) => { // We patch all these functions to add support for the following calls: // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto") - let value = args.pop(); + const value = args.pop(); let unit, asNumber; if (value === "auto") { @@ -95,7 +95,7 @@ module.exports = (lib) => { lib.Config.destroy(this); }); - patch(lib.Node, "create", function (_, config) { + patch(lib.Node, "create", (_, config) => { // We decide the constructor we want to call depending on the parameters return config ? lib.Node.createWithConfig(config) diff --git a/javascript/tests/Benchmarks/YGBenchmark.test.js b/javascript/tests/Benchmarks/YGBenchmark.test.js index 01192002..5ca47071 100644 --- a/javascript/tests/Benchmarks/YGBenchmark.test.js +++ b/javascript/tests/Benchmarks/YGBenchmark.test.js @@ -8,14 +8,14 @@ const ITERATIONS = 2000; const YGBENCHMARK = global.YGBENCHMARK ?? global.test; -YGBENCHMARK("Stack with flex", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Stack with flex", () => { + const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); - var measureCounter = getMeasureCounter(Yoga); + const measureCounter = getMeasureCounter(Yoga); - for (var i = 0; i < ITERATIONS; i++) { + for (let i = 0; i < ITERATIONS; i++) { const child = Yoga.Node.create(); child.setMeasureFunc(measureCounter.inc); child.setFlex(1); @@ -26,13 +26,13 @@ YGBENCHMARK("Stack with flex", function () { root.freeRecursive(); }); -YGBENCHMARK("Align stretch in undefined axis", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Align stretch in undefined axis", () => { + const root = Yoga.Node.create(); - var measureCounter = getMeasureCounter(Yoga); + const measureCounter = getMeasureCounter(Yoga); - for (var i = 0; i < ITERATIONS; i++) { - var child = Yoga.Node.create(); + for (let i = 0; i < ITERATIONS; i++) { + const child = Yoga.Node.create(); child.setMeasureFunc(measureCounter.inc); child.setHeight(20); root.insertChild(child, 0); @@ -42,20 +42,20 @@ YGBENCHMARK("Align stretch in undefined axis", function () { root.freeRecursive(); }); -YGBENCHMARK("Nested flex", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Nested flex", () => { + const root = Yoga.Node.create(); - var measureCounter = getMeasureCounter(Yoga); + const measureCounter = getMeasureCounter(Yoga); - var iterations = Math.pow(ITERATIONS, 1 / 2); + const iterations = Math.pow(ITERATIONS, 1 / 2); - for (var i = 0; i < iterations; i++) { - var child = Yoga.Node.create(); + for (let i = 0; i < iterations; i++) { + const child = Yoga.Node.create(); child.setFlex(1); root.insertChild(child, 0); - for (var ii = 0; ii < iterations; ii++) { - var grandChild = Yoga.Node.create(); + for (let ii = 0; ii < iterations; ii++) { + const grandChild = Yoga.Node.create(); grandChild.setMeasureFunc(measureCounter.inc); grandChild.setFlex(1); child.insertChild(grandChild, 0); @@ -66,35 +66,35 @@ YGBENCHMARK("Nested flex", function () { root.freeRecursive(); }); -YGBENCHMARK("Huge nested layout", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Huge nested layout", () => { + const root = Yoga.Node.create(); - var iterations = Math.pow(ITERATIONS, 1 / 4); + const iterations = Math.pow(ITERATIONS, 1 / 4); - for (var i = 0; i < iterations; i++) { - var child = Yoga.Node.create(); + for (let i = 0; i < iterations; i++) { + const child = Yoga.Node.create(); child.setFlexGrow(1); child.setWidth(10); child.setHeight(10); root.insertChild(child, 0); - for (var ii = 0; ii < iterations; ii++) { - var grandChild = Yoga.Node.create(); + for (let ii = 0; ii < iterations; ii++) { + const grandChild = Yoga.Node.create(); grandChild.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); grandChild.setFlexGrow(1); grandChild.setWidth(10); grandChild.setHeight(10); child.insertChild(grandChild, 0); - for (var iii = 0; iii < iterations; iii++) { - var grandGrandChild = Yoga.Node.create(); + for (let iii = 0; iii < iterations; iii++) { + const grandGrandChild = Yoga.Node.create(); grandGrandChild.setFlexGrow(1); grandGrandChild.setWidth(10); grandGrandChild.setHeight(10); grandChild.insertChild(grandGrandChild, 0); - for (var iiii = 0; iiii < iterations; iiii++) { - var grandGrandGrandChild = Yoga.Node.create(); + for (let iiii = 0; iiii < iterations; iiii++) { + const grandGrandGrandChild = Yoga.Node.create(); grandGrandGrandChild.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); grandGrandGrandChild.setFlexGrow(1); grandGrandGrandChild.setWidth(10); diff --git a/javascript/tests/YGAlignBaselineTest.test.js b/javascript/tests/YGAlignBaselineTest.test.js index 01c09837..6c99fa74 100644 --- a/javascript/tests/YGAlignBaselineTest.test.js +++ b/javascript/tests/YGAlignBaselineTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("align_baseline_parent_using_child_in_column_as_reference", function () { +test("align_baseline_parent_using_child_in_column_as_reference", () => { const config = Yoga.Config.create(); let root; @@ -63,7 +63,7 @@ test("align_baseline_parent_using_child_in_column_as_reference", function () { } }); -test("align_baseline_parent_using_child_in_row_as_reference", function () { +test("align_baseline_parent_using_child_in_row_as_reference", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/YGComputedBorderTest.test.js b/javascript/tests/YGComputedBorderTest.test.js index 37cb34c1..60445800 100644 --- a/javascript/tests/YGComputedBorderTest.test.js +++ b/javascript/tests/YGComputedBorderTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("border_start", function () { +test("border_start", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGComputedMarginTest.test.js b/javascript/tests/YGComputedMarginTest.test.js index 056c2ed8..a2e54a42 100644 --- a/javascript/tests/YGComputedMarginTest.test.js +++ b/javascript/tests/YGComputedMarginTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("margin_start", function () { +test("margin_start", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGComputedPaddingTest.test.js b/javascript/tests/YGComputedPaddingTest.test.js index 6292c6a4..cb538697 100644 --- a/javascript/tests/YGComputedPaddingTest.test.js +++ b/javascript/tests/YGComputedPaddingTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("padding_start", function () { +test("padding_start", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGDirtiedTest.test.js b/javascript/tests/YGDirtiedTest.test.js index 8209ec7f..befcc0e3 100644 --- a/javascript/tests/YGDirtiedTest.test.js +++ b/javascript/tests/YGDirtiedTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("dirtied", function () { +test("dirtied", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -14,11 +14,11 @@ test("dirtied", function () { root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function () { + root.setDirtiedFunc(() => { dirtied++; }); // only nodes with a measure function can be marked dirty - root.setMeasureFunc(function () {}); + root.setMeasureFunc(() => {}); expect(dirtied).toBe(0); @@ -33,7 +33,7 @@ test("dirtied", function () { root.freeRecursive(); }); -test("dirtied_propagation", function () { +test("dirtied_propagation", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -43,7 +43,7 @@ test("dirtied_propagation", function () { root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); - root_child0.setMeasureFunc(function () {}); + root_child0.setMeasureFunc(() => {}); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(); @@ -55,7 +55,7 @@ test("dirtied_propagation", function () { root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function () { + root.setDirtiedFunc(() => { dirtied++; }); @@ -72,7 +72,7 @@ test("dirtied_propagation", function () { root.freeRecursive(); }); -test("dirtied_hierarchy", function () { +test("dirtied_hierarchy", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -82,20 +82,20 @@ test("dirtied_hierarchy", function () { root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); - root_child0.setMeasureFunc(function () {}); + root_child0.setMeasureFunc(() => {}); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(); root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); root_child1.setWidth(50); root_child1.setHeight(20); - root_child1.setMeasureFunc(function () {}); + root_child1.setMeasureFunc(() => {}); root.insertChild(root_child1, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root_child0.setDirtiedFunc(function () { + root_child0.setDirtiedFunc(() => { dirtied++; }); @@ -115,17 +115,17 @@ test("dirtied_hierarchy", function () { root.freeRecursive(); }); -test("dirtied_reset", function () { +test("dirtied_reset", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - root.setMeasureFunc(function () {}); + root.setMeasureFunc(() => {}); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function () { + root.setDirtiedFunc(() => { dirtied++; }); @@ -142,7 +142,7 @@ test("dirtied_reset", function () { root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - root.setMeasureFunc(function () {}); + root.setMeasureFunc(() => {}); root.markDirty(); diff --git a/javascript/tests/YGMeasureCacheTest.test.js b/javascript/tests/YGMeasureCacheTest.test.js index 7c3f9af1..08c4e485 100644 --- a/javascript/tests/YGMeasureCacheTest.test.js +++ b/javascript/tests/YGMeasureCacheTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("measure_once_single_flexible_child", function () { +test("measure_once_single_flexible_child", () => { const root = Yoga.Node.create(); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_START); diff --git a/javascript/tests/YGMeasureTest.test.js b/javascript/tests/YGMeasureTest.test.js index 3aa674f7..d222af6f 100644 --- a/javascript/tests/YGMeasureTest.test.js +++ b/javascript/tests/YGMeasureTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("dont_measure_single_grow_shrink_child", function () { +test("dont_measure_single_grow_shrink_child", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index be782df6..7cd75cc1 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -test("absolute_layout_width_height_start_top", function () { +test("absolute_layout_width_height_start_top", () => { const config = Yoga.Config.create(); let root; @@ -54,7 +54,7 @@ test("absolute_layout_width_height_start_top", function () { config.free(); } }); -test("absolute_layout_width_height_end_bottom", function () { +test("absolute_layout_width_height_end_bottom", () => { const config = Yoga.Config.create(); let root; @@ -101,7 +101,7 @@ test("absolute_layout_width_height_end_bottom", function () { config.free(); } }); -test("absolute_layout_start_top_end_bottom", function () { +test("absolute_layout_start_top_end_bottom", () => { const config = Yoga.Config.create(); let root; @@ -148,7 +148,7 @@ test("absolute_layout_start_top_end_bottom", function () { config.free(); } }); -test("absolute_layout_width_height_start_top_end_bottom", function () { +test("absolute_layout_width_height_start_top_end_bottom", () => { const config = Yoga.Config.create(); let root; @@ -197,7 +197,7 @@ test("absolute_layout_width_height_start_top_end_bottom", function () { config.free(); } }); -test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () { +test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", () => { const config = Yoga.Config.create(); let root; @@ -259,7 +259,7 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare config.free(); } }); -test("absolute_layout_within_border", function () { +test("absolute_layout_within_border", () => { const config = Yoga.Config.create(); let root; @@ -380,7 +380,7 @@ test("absolute_layout_within_border", function () { config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center", function () { +test("absolute_layout_align_items_and_justify_content_center", () => { const config = Yoga.Config.create(); let root; @@ -428,7 +428,7 @@ test("absolute_layout_align_items_and_justify_content_center", function () { config.free(); } }); -test("absolute_layout_align_items_and_justify_content_flex_end", function () { +test("absolute_layout_align_items_and_justify_content_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -476,7 +476,7 @@ test("absolute_layout_align_items_and_justify_content_flex_end", function () { config.free(); } }); -test("absolute_layout_justify_content_center", function () { +test("absolute_layout_justify_content_center", () => { const config = Yoga.Config.create(); let root; @@ -523,7 +523,7 @@ test("absolute_layout_justify_content_center", function () { config.free(); } }); -test("absolute_layout_align_items_center", function () { +test("absolute_layout_align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -570,7 +570,7 @@ test("absolute_layout_align_items_center", function () { config.free(); } }); -test("absolute_layout_align_items_center_on_child_only", function () { +test("absolute_layout_align_items_center_on_child_only", () => { const config = Yoga.Config.create(); let root; @@ -617,7 +617,7 @@ test("absolute_layout_align_items_center_on_child_only", function () { config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_top_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_top_position", () => { const config = Yoga.Config.create(); let root; @@ -666,7 +666,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", () => { const config = Yoga.Config.create(); let root; @@ -715,7 +715,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_left_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_left_position", () => { const config = Yoga.Config.create(); let root; @@ -764,7 +764,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_right_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_right_position", () => { const config = Yoga.Config.create(); let root; @@ -813,7 +813,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" config.free(); } }); -test("position_root_with_rtl_should_position_withoutdirection", function () { +test("position_root_with_rtl_should_position_withoutdirection", () => { const config = Yoga.Config.create(); let root; @@ -843,7 +843,7 @@ test("position_root_with_rtl_should_position_withoutdirection", function () { config.free(); } }); -test("absolute_layout_percentage_bottom_based_on_parent_height", function () { +test("absolute_layout_percentage_bottom_based_on_parent_height", () => { const config = Yoga.Config.create(); let root; @@ -923,7 +923,7 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_column_container", function () { +test("absolute_layout_in_wrap_reverse_column_container", () => { const config = Yoga.Config.create(); let root; @@ -969,7 +969,7 @@ test("absolute_layout_in_wrap_reverse_column_container", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_row_container", function () { +test("absolute_layout_in_wrap_reverse_row_container", () => { const config = Yoga.Config.create(); let root; @@ -1016,7 +1016,7 @@ test("absolute_layout_in_wrap_reverse_row_container", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { +test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -1063,7 +1063,7 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_row_container_flex_end", function () { +test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js index 4454fd86..bd3ec73e 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -test("align_content_flex_start", function () { +test("align_content_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -113,7 +113,7 @@ test("align_content_flex_start", function () { config.free(); } }); -test("align_content_flex_start_without_height_on_children", function () { +test("align_content_flex_start_without_height_on_children", () => { const config = Yoga.Config.create(); let root; @@ -215,7 +215,7 @@ test("align_content_flex_start_without_height_on_children", function () { config.free(); } }); -test("align_content_flex_start_with_flex", function () { +test("align_content_flex_start_with_flex", () => { const config = Yoga.Config.create(); let root; @@ -323,7 +323,7 @@ test("align_content_flex_start_with_flex", function () { config.free(); } }); -test("align_content_flex_end", function () { +test("align_content_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -429,7 +429,7 @@ test("align_content_flex_end", function () { config.free(); } }); -test("align_content_stretch", function () { +test("align_content_stretch", () => { const config = Yoga.Config.create(); let root; @@ -530,7 +530,7 @@ test("align_content_stretch", function () { config.free(); } }); -test("align_content_spacebetween", function () { +test("align_content_spacebetween", () => { const config = Yoga.Config.create(); let root; @@ -637,7 +637,7 @@ test("align_content_spacebetween", function () { config.free(); } }); -test("align_content_spacearound", function () { +test("align_content_spacearound", () => { const config = Yoga.Config.create(); let root; @@ -744,7 +744,7 @@ test("align_content_spacearound", function () { config.free(); } }); -test("align_content_stretch_row", function () { +test("align_content_stretch_row", () => { const config = Yoga.Config.create(); let root; @@ -846,7 +846,7 @@ test("align_content_stretch_row", function () { config.free(); } }); -test("align_content_stretch_row_with_children", function () { +test("align_content_stretch_row_with_children", () => { const config = Yoga.Config.create(); let root; @@ -964,7 +964,7 @@ test("align_content_stretch_row_with_children", function () { config.free(); } }); -test("align_content_stretch_row_with_flex", function () { +test("align_content_stretch_row_with_flex", () => { const config = Yoga.Config.create(); let root; @@ -1072,7 +1072,7 @@ test("align_content_stretch_row_with_flex", function () { config.free(); } }); -test("align_content_stretch_row_with_flex_no_shrink", function () { +test("align_content_stretch_row_with_flex_no_shrink", () => { const config = Yoga.Config.create(); let root; @@ -1179,7 +1179,7 @@ test("align_content_stretch_row_with_flex_no_shrink", function () { config.free(); } }); -test("align_content_stretch_row_with_margin", function () { +test("align_content_stretch_row_with_margin", () => { const config = Yoga.Config.create(); let root; @@ -1289,7 +1289,7 @@ test("align_content_stretch_row_with_margin", function () { config.free(); } }); -test("align_content_stretch_row_with_padding", function () { +test("align_content_stretch_row_with_padding", () => { const config = Yoga.Config.create(); let root; @@ -1399,7 +1399,7 @@ test("align_content_stretch_row_with_padding", function () { config.free(); } }); -test("align_content_stretch_row_with_single_row", function () { +test("align_content_stretch_row_with_single_row", () => { const config = Yoga.Config.create(); let root; @@ -1459,7 +1459,7 @@ test("align_content_stretch_row_with_single_row", function () { config.free(); } }); -test("align_content_stretch_row_with_fixed_height", function () { +test("align_content_stretch_row_with_fixed_height", () => { const config = Yoga.Config.create(); let root; @@ -1562,7 +1562,7 @@ test("align_content_stretch_row_with_fixed_height", function () { config.free(); } }); -test("align_content_stretch_row_with_max_height", function () { +test("align_content_stretch_row_with_max_height", () => { const config = Yoga.Config.create(); let root; @@ -1665,7 +1665,7 @@ test("align_content_stretch_row_with_max_height", function () { config.free(); } }); -test("align_content_stretch_row_with_min_height", function () { +test("align_content_stretch_row_with_min_height", () => { const config = Yoga.Config.create(); let root; @@ -1768,7 +1768,7 @@ test("align_content_stretch_row_with_min_height", function () { config.free(); } }); -test("align_content_stretch_column", function () { +test("align_content_stretch_column", () => { const config = Yoga.Config.create(); let root; @@ -1888,7 +1888,7 @@ test("align_content_stretch_column", function () { config.free(); } }); -test("align_content_stretch_is_not_overriding_align_items", function () { +test("align_content_stretch_is_not_overriding_align_items", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index a53702c7..4f27c016 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -test("align_items_stretch", function () { +test("align_items_stretch", () => { const config = Yoga.Config.create(); let root; @@ -50,7 +50,7 @@ test("align_items_stretch", function () { config.free(); } }); -test("align_items_center", function () { +test("align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -95,7 +95,7 @@ test("align_items_center", function () { config.free(); } }); -test("align_items_flex_start", function () { +test("align_items_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -140,7 +140,7 @@ test("align_items_flex_start", function () { config.free(); } }); -test("align_items_flex_end", function () { +test("align_items_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -185,7 +185,7 @@ test("align_items_flex_end", function () { config.free(); } }); -test("align_baseline", function () { +test("align_baseline", () => { const config = Yoga.Config.create(); let root; @@ -246,7 +246,7 @@ test("align_baseline", function () { config.free(); } }); -test("align_baseline_child", function () { +test("align_baseline_child", () => { const config = Yoga.Config.create(); let root; @@ -322,7 +322,7 @@ test("align_baseline_child", function () { config.free(); } }); -test("align_baseline_child_multiline", function () { +test("align_baseline_child_multiline", () => { const config = Yoga.Config.create(); let root; @@ -445,7 +445,7 @@ test("align_baseline_child_multiline", function () { config.free(); } }); -test("align_baseline_child_multiline_override", function () { +test("align_baseline_child_multiline_override", () => { const config = Yoga.Config.create(); let root; @@ -570,7 +570,7 @@ test("align_baseline_child_multiline_override", function () { config.free(); } }); -test("align_baseline_child_multiline_no_override_on_secondline", function () { +test("align_baseline_child_multiline_no_override_on_secondline", () => { const config = Yoga.Config.create(); let root; @@ -694,7 +694,7 @@ test("align_baseline_child_multiline_no_override_on_secondline", function () { config.free(); } }); -test("align_baseline_child_top", function () { +test("align_baseline_child_top", () => { const config = Yoga.Config.create(); let root; @@ -771,7 +771,7 @@ test("align_baseline_child_top", function () { config.free(); } }); -test("align_baseline_child_top2", function () { +test("align_baseline_child_top2", () => { const config = Yoga.Config.create(); let root; @@ -848,7 +848,7 @@ test("align_baseline_child_top2", function () { config.free(); } }); -test("align_baseline_double_nested_child", function () { +test("align_baseline_double_nested_child", () => { const config = Yoga.Config.create(); let root; @@ -939,7 +939,7 @@ test("align_baseline_double_nested_child", function () { config.free(); } }); -test("align_baseline_column", function () { +test("align_baseline_column", () => { const config = Yoga.Config.create(); let root; @@ -999,7 +999,7 @@ test("align_baseline_column", function () { config.free(); } }); -test("align_baseline_child_margin", function () { +test("align_baseline_child_margin", () => { const config = Yoga.Config.create(); let root; @@ -1083,7 +1083,7 @@ test("align_baseline_child_margin", function () { config.free(); } }); -test("align_baseline_child_padding", function () { +test("align_baseline_child_padding", () => { const config = Yoga.Config.create(); let root; @@ -1167,7 +1167,7 @@ test("align_baseline_child_padding", function () { config.free(); } }); -test("align_baseline_multiline", function () { +test("align_baseline_multiline", () => { const config = Yoga.Config.create(); let root; @@ -1289,7 +1289,7 @@ test("align_baseline_multiline", function () { config.free(); } }); -test("align_baseline_multiline_column", function () { +test("align_baseline_multiline_column", () => { const config = Yoga.Config.create(); let root; @@ -1378,7 +1378,7 @@ test("align_baseline_multiline_column", function () { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedLeft()).toBe(70); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1388,7 +1388,7 @@ test("align_baseline_multiline_column", function () { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedLeft()).toBe(10); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1410,7 +1410,7 @@ test("align_baseline_multiline_column", function () { config.free(); } }); -test("align_baseline_multiline_column2", function () { +test("align_baseline_multiline_column2", () => { const config = Yoga.Config.create(); let root; @@ -1499,7 +1499,7 @@ test("align_baseline_multiline_column2", function () { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedLeft()).toBe(70); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1509,7 +1509,7 @@ test("align_baseline_multiline_column2", function () { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedLeft()).toBe(10); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1531,7 +1531,7 @@ test("align_baseline_multiline_column2", function () { config.free(); } }); -test("align_baseline_multiline_row_and_column", function () { +test("align_baseline_multiline_row_and_column", () => { const config = Yoga.Config.create(); let root; @@ -1653,7 +1653,7 @@ test("align_baseline_multiline_row_and_column", function () { config.free(); } }); -test("align_items_center_child_with_margin_bigger_than_parent", function () { +test("align_items_center_child_with_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1715,7 +1715,7 @@ test("align_items_center_child_with_margin_bigger_than_parent", function () { config.free(); } }); -test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { +test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1777,7 +1777,7 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { config.free(); } }); -test("align_items_center_child_without_margin_bigger_than_parent", function () { +test("align_items_center_child_without_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1837,7 +1837,7 @@ test("align_items_center_child_without_margin_bigger_than_parent", function () { config.free(); } }); -test("align_items_flex_end_child_without_margin_bigger_than_parent", function () { +test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1897,7 +1897,7 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", function () config.free(); } }); -test("align_center_should_size_based_on_content", function () { +test("align_center_should_size_based_on_content", () => { const config = Yoga.Config.create(); let root; @@ -1973,7 +1973,7 @@ test("align_center_should_size_based_on_content", function () { config.free(); } }); -test("align_stretch_should_size_based_on_parent", function () { +test("align_stretch_should_size_based_on_parent", () => { const config = Yoga.Config.create(); let root; @@ -2048,7 +2048,7 @@ test("align_stretch_should_size_based_on_parent", function () { config.free(); } }); -test("align_flex_start_with_shrinking_children", function () { +test("align_flex_start_with_shrinking_children", () => { const config = Yoga.Config.create(); let root; @@ -2121,7 +2121,7 @@ test("align_flex_start_with_shrinking_children", function () { config.free(); } }); -test("align_flex_start_with_stretching_children", function () { +test("align_flex_start_with_stretching_children", () => { const config = Yoga.Config.create(); let root; @@ -2193,7 +2193,7 @@ test("align_flex_start_with_stretching_children", function () { config.free(); } }); -test("align_flex_start_with_shrinking_children_with_stretch", function () { +test("align_flex_start_with_shrinking_children_with_stretch", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index feee7b0f..b8f1db3f 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -test("align_self_center", function () { +test("align_self_center", () => { const config = Yoga.Config.create(); let root; @@ -52,7 +52,7 @@ test("align_self_center", function () { config.free(); } }); -test("align_self_flex_end", function () { +test("align_self_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -97,7 +97,7 @@ test("align_self_flex_end", function () { config.free(); } }); -test("align_self_flex_start", function () { +test("align_self_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -142,7 +142,7 @@ test("align_self_flex_start", function () { config.free(); } }); -test("align_self_flex_end_override_flex_start", function () { +test("align_self_flex_end_override_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -188,7 +188,7 @@ test("align_self_flex_end_override_flex_start", function () { config.free(); } }); -test("align_self_baseline", function () { +test("align_self_baseline", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index 3b146bc5..c198cae1 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -test("android_news_feed", function () { +test("android_news_feed", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index 8d75a2b7..edd8aab8 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -test("border_no_size", function () { +test("border_no_size", () => { const config = Yoga.Config.create(); let root; @@ -38,7 +38,7 @@ test("border_no_size", function () { config.free(); } }); -test("border_container_match_child", function () { +test("border_container_match_child", () => { const config = Yoga.Config.create(); let root; @@ -84,7 +84,7 @@ test("border_container_match_child", function () { config.free(); } }); -test("border_flex_child", function () { +test("border_flex_child", () => { const config = Yoga.Config.create(); let root; @@ -132,7 +132,7 @@ test("border_flex_child", function () { config.free(); } }); -test("border_stretch_child", function () { +test("border_stretch_child", () => { const config = Yoga.Config.create(); let root; @@ -179,7 +179,7 @@ test("border_stretch_child", function () { config.free(); } }); -test("border_center_child", function () { +test("border_center_child", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index 96638b44..582b4e61 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -test("wrap_child", function () { +test("wrap_child", () => { const config = Yoga.Config.create(); let root; @@ -49,7 +49,7 @@ test("wrap_child", function () { config.free(); } }); -test("wrap_grandchild", function () { +test("wrap_grandchild", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index 3819330d..004ff905 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -test("display_none", function () { +test("display_none", () => { const config = Yoga.Config.create(); let root; @@ -66,7 +66,7 @@ test("display_none", function () { config.free(); } }); -test("display_none_fixed_size", function () { +test("display_none_fixed_size", () => { const config = Yoga.Config.create(); let root; @@ -126,7 +126,7 @@ test("display_none_fixed_size", function () { config.free(); } }); -test("display_none_with_margin", function () { +test("display_none_with_margin", () => { const config = Yoga.Config.create(); let root; @@ -190,7 +190,7 @@ test("display_none_with_margin", function () { config.free(); } }); -test("display_none_with_child", function () { +test("display_none_with_child", () => { const config = Yoga.Config.create(); let root; @@ -286,7 +286,7 @@ test("display_none_with_child", function () { config.free(); } }); -test("display_none_with_position", function () { +test("display_none_with_position", () => { const config = Yoga.Config.create(); let root; @@ -346,7 +346,7 @@ test("display_none_with_position", function () { config.free(); } }); -test("display_none_with_position_absolute", function () { +test("display_none_with_position_absolute", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index 70aa6e0c..d7c5e0d7 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -test("flex_direction_column_no_height", function () { +test("flex_direction_column_no_height", () => { const config = Yoga.Config.create(); let root; @@ -77,7 +77,7 @@ test("flex_direction_column_no_height", function () { config.free(); } }); -test("flex_direction_row_no_width", function () { +test("flex_direction_row_no_width", () => { const config = Yoga.Config.create(); let root; @@ -148,7 +148,7 @@ test("flex_direction_row_no_width", function () { config.free(); } }); -test("flex_direction_column", function () { +test("flex_direction_column", () => { const config = Yoga.Config.create(); let root; @@ -219,7 +219,7 @@ test("flex_direction_column", function () { config.free(); } }); -test("flex_direction_row", function () { +test("flex_direction_row", () => { const config = Yoga.Config.create(); let root; @@ -291,7 +291,7 @@ test("flex_direction_row", function () { config.free(); } }); -test("flex_direction_column_reverse", function () { +test("flex_direction_column_reverse", () => { const config = Yoga.Config.create(); let root; @@ -363,7 +363,7 @@ test("flex_direction_column_reverse", function () { config.free(); } }); -test("flex_direction_row_reverse", function () { +test("flex_direction_row_reverse", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index 93e997eb..141ad7cf 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -test("flex_basis_flex_grow_column", function () { +test("flex_basis_flex_grow_column", () => { const config = Yoga.Config.create(); let root; @@ -65,7 +65,7 @@ test("flex_basis_flex_grow_column", function () { config.free(); } }); -test("flex_shrink_flex_grow_row", function () { +test("flex_shrink_flex_grow_row", () => { const config = Yoga.Config.create(); let root; @@ -127,7 +127,7 @@ test("flex_shrink_flex_grow_row", function () { config.free(); } }); -test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { +test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { const config = Yoga.Config.create(); let root; @@ -190,7 +190,7 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { config.free(); } }); -test("flex_basis_flex_grow_row", function () { +test("flex_basis_flex_grow_row", () => { const config = Yoga.Config.create(); let root; @@ -249,7 +249,7 @@ test("flex_basis_flex_grow_row", function () { config.free(); } }); -test("flex_basis_flex_shrink_column", function () { +test("flex_basis_flex_shrink_column", () => { const config = Yoga.Config.create(); let root; @@ -307,7 +307,7 @@ test("flex_basis_flex_shrink_column", function () { config.free(); } }); -test("flex_basis_flex_shrink_row", function () { +test("flex_basis_flex_shrink_row", () => { const config = Yoga.Config.create(); let root; @@ -366,7 +366,7 @@ test("flex_basis_flex_shrink_row", function () { config.free(); } }); -test("flex_shrink_to_zero", function () { +test("flex_shrink_to_zero", () => { const config = Yoga.Config.create(); let root; @@ -440,7 +440,7 @@ test("flex_shrink_to_zero", function () { config.free(); } }); -test("flex_basis_overrides_main_size", function () { +test("flex_basis_overrides_main_size", () => { const config = Yoga.Config.create(); let root; @@ -515,7 +515,7 @@ test("flex_basis_overrides_main_size", function () { config.free(); } }); -test("flex_grow_shrink_at_most", function () { +test("flex_grow_shrink_at_most", () => { const config = Yoga.Config.create(); let root; @@ -572,7 +572,7 @@ test("flex_grow_shrink_at_most", function () { config.free(); } }); -test("flex_grow_less_than_factor_one", function () { +test("flex_grow_less_than_factor_one", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index e670b7ca..cd0388dd 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -test("wrap_column", function () { +test("wrap_column", () => { const config = Yoga.Config.create(); let root; @@ -96,7 +96,7 @@ test("wrap_column", function () { config.free(); } }); -test("wrap_row", function () { +test("wrap_row", () => { const config = Yoga.Config.create(); let root; @@ -186,7 +186,7 @@ test("wrap_row", function () { config.free(); } }); -test("wrap_row_align_items_flex_end", function () { +test("wrap_row_align_items_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -277,7 +277,7 @@ test("wrap_row_align_items_flex_end", function () { config.free(); } }); -test("wrap_row_align_items_center", function () { +test("wrap_row_align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -368,7 +368,7 @@ test("wrap_row_align_items_center", function () { config.free(); } }); -test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { +test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { const config = Yoga.Config.create(); let root; @@ -430,7 +430,7 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { config.free(); } }); -test("flex_wrap_wrap_to_child_height", function () { +test("flex_wrap_wrap_to_child_height", () => { const config = Yoga.Config.create(); let root; @@ -517,7 +517,7 @@ test("flex_wrap_wrap_to_child_height", function () { config.free(); } }); -test("flex_wrap_align_stretch_fits_one_row", function () { +test("flex_wrap_align_stretch_fits_one_row", () => { const config = Yoga.Config.create(); let root; @@ -576,7 +576,7 @@ test("flex_wrap_align_stretch_fits_one_row", function () { config.free(); } }); -test("wrap_reverse_row_align_content_flex_start", function () { +test("wrap_reverse_row_align_content_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -681,7 +681,7 @@ test("wrap_reverse_row_align_content_flex_start", function () { config.free(); } }); -test("wrap_reverse_row_align_content_center", function () { +test("wrap_reverse_row_align_content_center", () => { const config = Yoga.Config.create(); let root; @@ -787,7 +787,7 @@ test("wrap_reverse_row_align_content_center", function () { config.free(); } }); -test("wrap_reverse_row_single_line_different_size", function () { +test("wrap_reverse_row_single_line_different_size", () => { const config = Yoga.Config.create(); let root; @@ -892,7 +892,7 @@ test("wrap_reverse_row_single_line_different_size", function () { config.free(); } }); -test("wrap_reverse_row_align_content_stretch", function () { +test("wrap_reverse_row_align_content_stretch", () => { const config = Yoga.Config.create(); let root; @@ -998,7 +998,7 @@ test("wrap_reverse_row_align_content_stretch", function () { config.free(); } }); -test("wrap_reverse_row_align_content_space_around", function () { +test("wrap_reverse_row_align_content_space_around", () => { const config = Yoga.Config.create(); let root; @@ -1104,7 +1104,7 @@ test("wrap_reverse_row_align_content_space_around", function () { config.free(); } }); -test("wrap_reverse_column_fixed_size", function () { +test("wrap_reverse_column_fixed_size", () => { const config = Yoga.Config.create(); let root; @@ -1210,7 +1210,7 @@ test("wrap_reverse_column_fixed_size", function () { config.free(); } }); -test("wrapped_row_within_align_items_center", function () { +test("wrapped_row_within_align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -1285,7 +1285,7 @@ test("wrapped_row_within_align_items_center", function () { config.free(); } }); -test("wrapped_row_within_align_items_flex_start", function () { +test("wrapped_row_within_align_items_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -1360,7 +1360,7 @@ test("wrapped_row_within_align_items_flex_start", function () { config.free(); } }); -test("wrapped_row_within_align_items_flex_end", function () { +test("wrapped_row_within_align_items_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -1435,7 +1435,7 @@ test("wrapped_row_within_align_items_flex_end", function () { config.free(); } }); -test("wrapped_column_max_height", function () { +test("wrapped_column_max_height", () => { const config = Yoga.Config.create(); let root; @@ -1518,7 +1518,7 @@ test("wrapped_column_max_height", function () { config.free(); } }); -test("wrapped_column_max_height_flex", function () { +test("wrapped_column_max_height_flex", () => { const config = Yoga.Config.create(); let root; @@ -1607,7 +1607,7 @@ test("wrapped_column_max_height_flex", function () { config.free(); } }); -test("wrap_nodes_with_content_sizing_overflowing_margin", function () { +test("wrap_nodes_with_content_sizing_overflowing_margin", () => { const config = Yoga.Config.create(); let root; @@ -1709,7 +1709,7 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", function () { config.free(); } }); -test("wrap_nodes_with_content_sizing_margin_cross", function () { +test("wrap_nodes_with_content_sizing_margin_cross", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index ca2bc2c8..11ffa6d6 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -test("column_gap_flexible", function () { +test("column_gap_flexible", () => { const config = Yoga.Config.create(); let root; @@ -87,7 +87,7 @@ test("column_gap_flexible", function () { config.free(); } }); -test("column_gap_inflexible", function () { +test("column_gap_inflexible", () => { const config = Yoga.Config.create(); let root; @@ -160,7 +160,7 @@ test("column_gap_inflexible", function () { config.free(); } }); -test("column_gap_mixed_flexible", function () { +test("column_gap_mixed_flexible", () => { const config = Yoga.Config.create(); let root; @@ -235,7 +235,7 @@ test("column_gap_mixed_flexible", function () { config.free(); } }); -test("column_gap_child_margins", function () { +test("column_gap_child_margins", () => { const config = Yoga.Config.create(); let root; @@ -320,7 +320,7 @@ test("column_gap_child_margins", function () { config.free(); } }); -test("column_row_gap_wrapping", function () { +test("column_row_gap_wrapping", () => { const config = Yoga.Config.create(); let root; @@ -487,7 +487,7 @@ test("column_row_gap_wrapping", function () { config.free(); } }); -test("column_gap_justify_flex_start", function () { +test("column_gap_justify_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -560,7 +560,7 @@ test("column_gap_justify_flex_start", function () { config.free(); } }); -test("column_gap_justify_center", function () { +test("column_gap_justify_center", () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("column_gap_justify_center", function () { config.free(); } }); -test("column_gap_justify_flex_end", function () { +test("column_gap_justify_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -708,7 +708,7 @@ test("column_gap_justify_flex_end", function () { config.free(); } }); -test("column_gap_justify_space_between", function () { +test("column_gap_justify_space_between", () => { const config = Yoga.Config.create(); let root; @@ -782,7 +782,7 @@ test("column_gap_justify_space_between", function () { config.free(); } }); -test("column_gap_justify_space_around", function () { +test("column_gap_justify_space_around", () => { const config = Yoga.Config.create(); let root; @@ -856,7 +856,7 @@ test("column_gap_justify_space_around", function () { config.free(); } }); -test("column_gap_justify_space_evenly", function () { +test("column_gap_justify_space_evenly", () => { const config = Yoga.Config.create(); let root; @@ -930,7 +930,7 @@ test("column_gap_justify_space_evenly", function () { config.free(); } }); -test("column_gap_wrap_align_flex_start", function () { +test("column_gap_wrap_align_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -1053,7 +1053,7 @@ test("column_gap_wrap_align_flex_start", function () { config.free(); } }); -test("column_gap_wrap_align_center", function () { +test("column_gap_wrap_align_center", () => { const config = Yoga.Config.create(); let root; @@ -1177,7 +1177,7 @@ test("column_gap_wrap_align_center", function () { config.free(); } }); -test("column_gap_wrap_align_flex_end", function () { +test("column_gap_wrap_align_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -1301,7 +1301,7 @@ test("column_gap_wrap_align_flex_end", function () { config.free(); } }); -test("column_gap_wrap_align_space_between", function () { +test("column_gap_wrap_align_space_between", () => { const config = Yoga.Config.create(); let root; @@ -1425,7 +1425,7 @@ test("column_gap_wrap_align_space_between", function () { config.free(); } }); -test("column_gap_wrap_align_space_around", function () { +test("column_gap_wrap_align_space_around", () => { const config = Yoga.Config.create(); let root; @@ -1549,7 +1549,7 @@ test("column_gap_wrap_align_space_around", function () { config.free(); } }); -test("column_gap_wrap_align_stretch", function () { +test("column_gap_wrap_align_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1657,7 +1657,7 @@ test("column_gap_wrap_align_stretch", function () { config.free(); } }); -test("column_gap_determines_parent_width", function () { +test("column_gap_determines_parent_width", () => { const config = Yoga.Config.create(); let root; @@ -1729,7 +1729,7 @@ test("column_gap_determines_parent_width", function () { config.free(); } }); -test("row_gap_align_items_stretch", function () { +test("row_gap_align_items_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1847,7 +1847,7 @@ test("row_gap_align_items_stretch", function () { config.free(); } }); -test("row_gap_align_items_end", function () { +test("row_gap_align_items_end", () => { const config = Yoga.Config.create(); let root; @@ -1965,7 +1965,7 @@ test("row_gap_align_items_end", function () { config.free(); } }); -test("row_gap_column_child_margins", function () { +test("row_gap_column_child_margins", () => { const config = Yoga.Config.create(); let root; @@ -2049,7 +2049,7 @@ test("row_gap_column_child_margins", function () { config.free(); } }); -test("row_gap_row_wrap_child_margins", function () { +test("row_gap_row_wrap_child_margins", () => { const config = Yoga.Config.create(); let root; @@ -2129,7 +2129,7 @@ test("row_gap_row_wrap_child_margins", function () { config.free(); } }); -test("row_gap_determines_parent_height", function () { +test("row_gap_determines_parent_height", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index bca80053..145eb54a 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -test("justify_content_row_flex_start", function () { +test("justify_content_row_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -79,7 +79,7 @@ test("justify_content_row_flex_start", function () { config.free(); } }); -test("justify_content_row_flex_end", function () { +test("justify_content_row_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -152,7 +152,7 @@ test("justify_content_row_flex_end", function () { config.free(); } }); -test("justify_content_row_center", function () { +test("justify_content_row_center", () => { const config = Yoga.Config.create(); let root; @@ -225,7 +225,7 @@ test("justify_content_row_center", function () { config.free(); } }); -test("justify_content_row_space_between", function () { +test("justify_content_row_space_between", () => { const config = Yoga.Config.create(); let root; @@ -298,7 +298,7 @@ test("justify_content_row_space_between", function () { config.free(); } }); -test("justify_content_row_space_around", function () { +test("justify_content_row_space_around", () => { const config = Yoga.Config.create(); let root; @@ -371,7 +371,7 @@ test("justify_content_row_space_around", function () { config.free(); } }); -test("justify_content_column_flex_start", function () { +test("justify_content_column_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -442,7 +442,7 @@ test("justify_content_column_flex_start", function () { config.free(); } }); -test("justify_content_column_flex_end", function () { +test("justify_content_column_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -514,7 +514,7 @@ test("justify_content_column_flex_end", function () { config.free(); } }); -test("justify_content_column_center", function () { +test("justify_content_column_center", () => { const config = Yoga.Config.create(); let root; @@ -586,7 +586,7 @@ test("justify_content_column_center", function () { config.free(); } }); -test("justify_content_column_space_between", function () { +test("justify_content_column_space_between", () => { const config = Yoga.Config.create(); let root; @@ -658,7 +658,7 @@ test("justify_content_column_space_between", function () { config.free(); } }); -test("justify_content_column_space_around", function () { +test("justify_content_column_space_around", () => { const config = Yoga.Config.create(); let root; @@ -730,7 +730,7 @@ test("justify_content_column_space_around", function () { config.free(); } }); -test("justify_content_row_min_width_and_margin", function () { +test("justify_content_row_min_width_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -776,7 +776,7 @@ test("justify_content_row_min_width_and_margin", function () { config.free(); } }); -test("justify_content_row_max_width_and_margin", function () { +test("justify_content_row_max_width_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -823,7 +823,7 @@ test("justify_content_row_max_width_and_margin", function () { config.free(); } }); -test("justify_content_column_min_height_and_margin", function () { +test("justify_content_column_min_height_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -868,7 +868,7 @@ test("justify_content_column_min_height_and_margin", function () { config.free(); } }); -test("justify_content_colunn_max_height_and_margin", function () { +test("justify_content_colunn_max_height_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -914,7 +914,7 @@ test("justify_content_colunn_max_height_and_margin", function () { config.free(); } }); -test("justify_content_column_space_evenly", function () { +test("justify_content_column_space_evenly", () => { const config = Yoga.Config.create(); let root; @@ -986,7 +986,7 @@ test("justify_content_column_space_evenly", function () { config.free(); } }); -test("justify_content_row_space_evenly", function () { +test("justify_content_row_space_evenly", () => { const config = Yoga.Config.create(); let root; @@ -1059,7 +1059,7 @@ test("justify_content_row_space_evenly", function () { config.free(); } }); -test("justify_content_min_width_with_padding_child_width_greater_than_parent", function () { +test("justify_content_min_width_with_padding_child_width_greater_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1140,7 +1140,7 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", f config.free(); } }); -test("justify_content_min_width_with_padding_child_width_lower_than_parent", function () { +test("justify_content_min_width_with_padding_child_width_lower_than_parent", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index debf3c49..888b189a 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -test("margin_start", function () { +test("margin_start", () => { const config = Yoga.Config.create(); let root; @@ -52,7 +52,7 @@ test("margin_start", function () { config.free(); } }); -test("margin_top", function () { +test("margin_top", () => { const config = Yoga.Config.create(); let root; @@ -96,7 +96,7 @@ test("margin_top", function () { config.free(); } }); -test("margin_end", function () { +test("margin_end", () => { const config = Yoga.Config.create(); let root; @@ -142,7 +142,7 @@ test("margin_end", function () { config.free(); } }); -test("margin_bottom", function () { +test("margin_bottom", () => { const config = Yoga.Config.create(); let root; @@ -187,7 +187,7 @@ test("margin_bottom", function () { config.free(); } }); -test("margin_and_flex_row", function () { +test("margin_and_flex_row", () => { const config = Yoga.Config.create(); let root; @@ -233,7 +233,7 @@ test("margin_and_flex_row", function () { config.free(); } }); -test("margin_and_flex_column", function () { +test("margin_and_flex_column", () => { const config = Yoga.Config.create(); let root; @@ -278,7 +278,7 @@ test("margin_and_flex_column", function () { config.free(); } }); -test("margin_and_stretch_row", function () { +test("margin_and_stretch_row", () => { const config = Yoga.Config.create(); let root; @@ -324,7 +324,7 @@ test("margin_and_stretch_row", function () { config.free(); } }); -test("margin_and_stretch_column", function () { +test("margin_and_stretch_column", () => { const config = Yoga.Config.create(); let root; @@ -369,7 +369,7 @@ test("margin_and_stretch_column", function () { config.free(); } }); -test("margin_with_sibling_row", function () { +test("margin_with_sibling_row", () => { const config = Yoga.Config.create(); let root; @@ -428,7 +428,7 @@ test("margin_with_sibling_row", function () { config.free(); } }); -test("margin_with_sibling_column", function () { +test("margin_with_sibling_column", () => { const config = Yoga.Config.create(); let root; @@ -486,7 +486,7 @@ test("margin_with_sibling_column", function () { config.free(); } }); -test("margin_auto_bottom", function () { +test("margin_auto_bottom", () => { const config = Yoga.Config.create(); let root; @@ -547,7 +547,7 @@ test("margin_auto_bottom", function () { config.free(); } }); -test("margin_auto_top", function () { +test("margin_auto_top", () => { const config = Yoga.Config.create(); let root; @@ -608,7 +608,7 @@ test("margin_auto_top", function () { config.free(); } }); -test("margin_auto_bottom_and_top", function () { +test("margin_auto_bottom_and_top", () => { const config = Yoga.Config.create(); let root; @@ -670,7 +670,7 @@ test("margin_auto_bottom_and_top", function () { config.free(); } }); -test("margin_auto_bottom_and_top_justify_center", function () { +test("margin_auto_bottom_and_top_justify_center", () => { const config = Yoga.Config.create(); let root; @@ -732,7 +732,7 @@ test("margin_auto_bottom_and_top_justify_center", function () { config.free(); } }); -test("margin_auto_mutiple_children_column", function () { +test("margin_auto_mutiple_children_column", () => { const config = Yoga.Config.create(); let root; @@ -809,7 +809,7 @@ test("margin_auto_mutiple_children_column", function () { config.free(); } }); -test("margin_auto_mutiple_children_row", function () { +test("margin_auto_mutiple_children_row", () => { const config = Yoga.Config.create(); let root; @@ -887,7 +887,7 @@ test("margin_auto_mutiple_children_row", function () { config.free(); } }); -test("margin_auto_left_and_right_column", function () { +test("margin_auto_left_and_right_column", () => { const config = Yoga.Config.create(); let root; @@ -950,7 +950,7 @@ test("margin_auto_left_and_right_column", function () { config.free(); } }); -test("margin_auto_left_and_right", function () { +test("margin_auto_left_and_right", () => { const config = Yoga.Config.create(); let root; @@ -1011,7 +1011,7 @@ test("margin_auto_left_and_right", function () { config.free(); } }); -test("margin_auto_start_and_end_column", function () { +test("margin_auto_start_and_end_column", () => { const config = Yoga.Config.create(); let root; @@ -1074,7 +1074,7 @@ test("margin_auto_start_and_end_column", function () { config.free(); } }); -test("margin_auto_start_and_end", function () { +test("margin_auto_start_and_end", () => { const config = Yoga.Config.create(); let root; @@ -1135,7 +1135,7 @@ test("margin_auto_start_and_end", function () { config.free(); } }); -test("margin_auto_left_and_right_column_and_center", function () { +test("margin_auto_left_and_right_column_and_center", () => { const config = Yoga.Config.create(); let root; @@ -1197,7 +1197,7 @@ test("margin_auto_left_and_right_column_and_center", function () { config.free(); } }); -test("margin_auto_left", function () { +test("margin_auto_left", () => { const config = Yoga.Config.create(); let root; @@ -1258,7 +1258,7 @@ test("margin_auto_left", function () { config.free(); } }); -test("margin_auto_right", function () { +test("margin_auto_right", () => { const config = Yoga.Config.create(); let root; @@ -1319,7 +1319,7 @@ test("margin_auto_right", function () { config.free(); } }); -test("margin_auto_left_and_right_stretch", function () { +test("margin_auto_left_and_right_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1381,7 +1381,7 @@ test("margin_auto_left_and_right_stretch", function () { config.free(); } }); -test("margin_auto_top_and_bottom_stretch", function () { +test("margin_auto_top_and_bottom_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1442,7 +1442,7 @@ test("margin_auto_top_and_bottom_stretch", function () { config.free(); } }); -test("margin_should_not_be_part_of_max_height", function () { +test("margin_should_not_be_part_of_max_height", () => { const config = Yoga.Config.create(); let root; @@ -1488,7 +1488,7 @@ test("margin_should_not_be_part_of_max_height", function () { config.free(); } }); -test("margin_should_not_be_part_of_max_width", function () { +test("margin_should_not_be_part_of_max_width", () => { const config = Yoga.Config.create(); let root; @@ -1534,7 +1534,7 @@ test("margin_should_not_be_part_of_max_width", function () { config.free(); } }); -test("margin_auto_left_right_child_bigger_than_parent", function () { +test("margin_auto_left_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1581,7 +1581,7 @@ test("margin_auto_left_right_child_bigger_than_parent", function () { config.free(); } }); -test("margin_auto_left_child_bigger_than_parent", function () { +test("margin_auto_left_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1627,7 +1627,7 @@ test("margin_auto_left_child_bigger_than_parent", function () { config.free(); } }); -test("margin_fix_left_auto_right_child_bigger_than_parent", function () { +test("margin_fix_left_auto_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1674,7 +1674,7 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", function () { config.free(); } }); -test("margin_auto_left_fix_right_child_bigger_than_parent", function () { +test("margin_auto_left_fix_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1721,7 +1721,7 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", function () { config.free(); } }); -test("margin_auto_top_stretching_child", function () { +test("margin_auto_top_stretching_child", () => { const config = Yoga.Config.create(); let root; @@ -1783,7 +1783,7 @@ test("margin_auto_top_stretching_child", function () { config.free(); } }); -test("margin_auto_left_stretching_child", function () { +test("margin_auto_left_stretching_child", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index f2c63f30..0642e299 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -test("max_width", function () { +test("max_width", () => { const config = Yoga.Config.create(); let root; @@ -51,7 +51,7 @@ test("max_width", function () { config.free(); } }); -test("max_height", function () { +test("max_height", () => { const config = Yoga.Config.create(); let root; @@ -96,7 +96,7 @@ test("max_height", function () { config.free(); } }); -test("justify_content_min_max", function () { +test("justify_content_min_max", () => { const config = Yoga.Config.create(); let root; @@ -142,7 +142,7 @@ test("justify_content_min_max", function () { config.free(); } }); -test("align_items_min_max", function () { +test("align_items_min_max", () => { const config = Yoga.Config.create(); let root; @@ -188,7 +188,7 @@ test("align_items_min_max", function () { config.free(); } }); -test("justify_content_overflow_min_max", function () { +test("justify_content_overflow_min_max", () => { const config = Yoga.Config.create(); let root; @@ -263,7 +263,7 @@ test("justify_content_overflow_min_max", function () { config.free(); } }); -test("flex_grow_to_min", function () { +test("flex_grow_to_min", () => { const config = Yoga.Config.create(); let root; @@ -322,7 +322,7 @@ test("flex_grow_to_min", function () { config.free(); } }); -test("flex_grow_in_at_most_container", function () { +test("flex_grow_in_at_most_container", () => { const config = Yoga.Config.create(); let root; @@ -382,7 +382,7 @@ test("flex_grow_in_at_most_container", function () { config.free(); } }); -test("flex_grow_child", function () { +test("flex_grow_child", () => { const config = Yoga.Config.create(); let root; @@ -426,7 +426,7 @@ test("flex_grow_child", function () { config.free(); } }); -test("flex_grow_within_constrained_min_max_column", function () { +test("flex_grow_within_constrained_min_max_column", () => { const config = Yoga.Config.create(); let root; @@ -483,7 +483,7 @@ test("flex_grow_within_constrained_min_max_column", function () { config.free(); } }); -test("flex_grow_within_max_width", function () { +test("flex_grow_within_max_width", () => { const config = Yoga.Config.create(); let root; @@ -542,7 +542,7 @@ test("flex_grow_within_max_width", function () { config.free(); } }); -test("flex_grow_within_constrained_max_width", function () { +test("flex_grow_within_constrained_max_width", () => { const config = Yoga.Config.create(); let root; @@ -601,7 +601,7 @@ test("flex_grow_within_constrained_max_width", function () { config.free(); } }); -test("flex_root_ignored", function () { +test("flex_root_ignored", () => { const config = Yoga.Config.create(); let root; @@ -661,7 +661,7 @@ test("flex_root_ignored", function () { config.free(); } }); -test("flex_grow_root_minimized", function () { +test("flex_grow_root_minimized", () => { const config = Yoga.Config.create(); let root; @@ -736,7 +736,7 @@ test("flex_grow_root_minimized", function () { config.free(); } }); -test("flex_grow_height_maximized", function () { +test("flex_grow_height_maximized", () => { const config = Yoga.Config.create(); let root; @@ -810,7 +810,7 @@ test("flex_grow_height_maximized", function () { config.free(); } }); -test("flex_grow_within_constrained_min_row", function () { +test("flex_grow_within_constrained_min_row", () => { const config = Yoga.Config.create(); let root; @@ -868,7 +868,7 @@ test("flex_grow_within_constrained_min_row", function () { config.free(); } }); -test("flex_grow_within_constrained_min_column", function () { +test("flex_grow_within_constrained_min_column", () => { const config = Yoga.Config.create(); let root; @@ -924,7 +924,7 @@ test("flex_grow_within_constrained_min_column", function () { config.free(); } }); -test("flex_grow_within_constrained_max_row", function () { +test("flex_grow_within_constrained_max_row", () => { const config = Yoga.Config.create(); let root; @@ -997,7 +997,7 @@ test("flex_grow_within_constrained_max_row", function () { config.free(); } }); -test("flex_grow_within_constrained_max_column", function () { +test("flex_grow_within_constrained_max_column", () => { const config = Yoga.Config.create(); let root; @@ -1055,7 +1055,7 @@ test("flex_grow_within_constrained_max_column", function () { config.free(); } }); -test("child_min_max_width_flexing", function () { +test("child_min_max_width_flexing", () => { const config = Yoga.Config.create(); let root; @@ -1117,7 +1117,7 @@ test("child_min_max_width_flexing", function () { config.free(); } }); -test("min_width_overrides_width", function () { +test("min_width_overrides_width", () => { const config = Yoga.Config.create(); let root; @@ -1146,7 +1146,7 @@ test("min_width_overrides_width", function () { config.free(); } }); -test("max_width_overrides_width", function () { +test("max_width_overrides_width", () => { const config = Yoga.Config.create(); let root; @@ -1175,7 +1175,7 @@ test("max_width_overrides_width", function () { config.free(); } }); -test("min_height_overrides_height", function () { +test("min_height_overrides_height", () => { const config = Yoga.Config.create(); let root; @@ -1204,7 +1204,7 @@ test("min_height_overrides_height", function () { config.free(); } }); -test("max_height_overrides_height", function () { +test("max_height_overrides_height", () => { const config = Yoga.Config.create(); let root; @@ -1233,7 +1233,7 @@ test("max_height_overrides_height", function () { config.free(); } }); -test("min_max_percent_no_width_height", function () { +test("min_max_percent_no_width_height", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index 8e2df73e..1f9498c3 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -test("padding_no_size", function () { +test("padding_no_size", () => { const config = Yoga.Config.create(); let root; @@ -38,7 +38,7 @@ test("padding_no_size", function () { config.free(); } }); -test("padding_container_match_child", function () { +test("padding_container_match_child", () => { const config = Yoga.Config.create(); let root; @@ -84,7 +84,7 @@ test("padding_container_match_child", function () { config.free(); } }); -test("padding_flex_child", function () { +test("padding_flex_child", () => { const config = Yoga.Config.create(); let root; @@ -132,7 +132,7 @@ test("padding_flex_child", function () { config.free(); } }); -test("padding_stretch_child", function () { +test("padding_stretch_child", () => { const config = Yoga.Config.create(); let root; @@ -179,7 +179,7 @@ test("padding_stretch_child", function () { config.free(); } }); -test("padding_center_child", function () { +test("padding_center_child", () => { const config = Yoga.Config.create(); let root; @@ -228,7 +228,7 @@ test("padding_center_child", function () { config.free(); } }); -test("child_with_padding_align_end", function () { +test("child_with_padding_align_end", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index def08b5a..2c34df61 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -test("percentage_width_height", function () { +test("percentage_width_height", () => { const config = Yoga.Config.create(); let root; @@ -52,7 +52,7 @@ test("percentage_width_height", function () { config.free(); } }); -test("percentage_position_left_top", function () { +test("percentage_position_left_top", () => { const config = Yoga.Config.create(); let root; @@ -99,7 +99,7 @@ test("percentage_position_left_top", function () { config.free(); } }); -test("percentage_position_bottom_right", function () { +test("percentage_position_bottom_right", () => { const config = Yoga.Config.create(); let root; @@ -146,7 +146,7 @@ test("percentage_position_bottom_right", function () { config.free(); } }); -test("percentage_flex_basis", function () { +test("percentage_flex_basis", () => { const config = Yoga.Config.create(); let root; @@ -206,7 +206,7 @@ test("percentage_flex_basis", function () { config.free(); } }); -test("percentage_flex_basis_cross", function () { +test("percentage_flex_basis_cross", () => { const config = Yoga.Config.create(); let root; @@ -265,7 +265,7 @@ test("percentage_flex_basis_cross", function () { config.free(); } }); -test("percentage_flex_basis_main_max_height", function () { +test("percentage_flex_basis_main_max_height", () => { const config = Yoga.Config.create(); let root; @@ -327,7 +327,7 @@ test("percentage_flex_basis_main_max_height", function () { config.free(); } }); -test("percentage_flex_basis_cross_max_height", function () { +test("percentage_flex_basis_cross_max_height", () => { const config = Yoga.Config.create(); let root; @@ -388,7 +388,7 @@ test("percentage_flex_basis_cross_max_height", function () { config.free(); } }); -test("percentage_flex_basis_main_max_width", function () { +test("percentage_flex_basis_main_max_width", () => { const config = Yoga.Config.create(); let root; @@ -450,7 +450,7 @@ test("percentage_flex_basis_main_max_width", function () { config.free(); } }); -test("percentage_flex_basis_cross_max_width", function () { +test("percentage_flex_basis_cross_max_width", () => { const config = Yoga.Config.create(); let root; @@ -511,7 +511,7 @@ test("percentage_flex_basis_cross_max_width", function () { config.free(); } }); -test("percentage_flex_basis_main_min_width", function () { +test("percentage_flex_basis_main_min_width", () => { const config = Yoga.Config.create(); let root; @@ -573,7 +573,7 @@ test("percentage_flex_basis_main_min_width", function () { config.free(); } }); -test("percentage_flex_basis_cross_min_width", function () { +test("percentage_flex_basis_cross_min_width", () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("percentage_flex_basis_cross_min_width", function () { config.free(); } }); -test("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () { +test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () => { const config = Yoga.Config.create(); let root; @@ -747,7 +747,7 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", fun config.free(); } }); -test("percentage_margin_should_calculate_based_only_on_width", function () { +test("percentage_margin_should_calculate_based_only_on_width", () => { const config = Yoga.Config.create(); let root; @@ -809,7 +809,7 @@ test("percentage_margin_should_calculate_based_only_on_width", function () { config.free(); } }); -test("percentage_padding_should_calculate_based_only_on_width", function () { +test("percentage_padding_should_calculate_based_only_on_width", () => { const config = Yoga.Config.create(); let root; @@ -871,7 +871,7 @@ test("percentage_padding_should_calculate_based_only_on_width", function () { config.free(); } }); -test("percentage_absolute_position", function () { +test("percentage_absolute_position", () => { const config = Yoga.Config.create(); let root; @@ -918,7 +918,7 @@ test("percentage_absolute_position", function () { config.free(); } }); -test("percentage_width_height_undefined_parent_size", function () { +test("percentage_width_height_undefined_parent_size", () => { const config = Yoga.Config.create(); let root; @@ -960,7 +960,7 @@ test("percentage_width_height_undefined_parent_size", function () { config.free(); } }); -test("percent_within_flex_grow", function () { +test("percent_within_flex_grow", () => { const config = Yoga.Config.create(); let root; @@ -1046,7 +1046,7 @@ test("percent_within_flex_grow", function () { config.free(); } }); -test("percentage_container_in_wrapping_container", function () { +test("percentage_container_in_wrapping_container", () => { const config = Yoga.Config.create(); let root; @@ -1136,7 +1136,7 @@ test("percentage_container_in_wrapping_container", function () { config.free(); } }); -test("percent_absolute_position", function () { +test("percent_absolute_position", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index 52937ca8..c1cac6e4 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -test("rounding_flex_basis_flex_grow_row_width_of_100", function () { +test("rounding_flex_basis_flex_grow_row_width_of_100", () => { const config = Yoga.Config.create(); let root; @@ -79,7 +79,7 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", function () { config.free(); } }); -test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { +test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { const config = Yoga.Config.create(); let root; @@ -179,7 +179,7 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { config.free(); } }); -test("rounding_flex_basis_flex_shrink_row", function () { +test("rounding_flex_basis_flex_shrink_row", () => { const config = Yoga.Config.create(); let root; @@ -252,7 +252,7 @@ test("rounding_flex_basis_flex_shrink_row", function () { config.free(); } }); -test("rounding_flex_basis_overrides_main_size", function () { +test("rounding_flex_basis_overrides_main_size", () => { const config = Yoga.Config.create(); let root; @@ -327,7 +327,7 @@ test("rounding_flex_basis_overrides_main_size", function () { config.free(); } }); -test("rounding_total_fractial", function () { +test("rounding_total_fractial", () => { const config = Yoga.Config.create(); let root; @@ -402,7 +402,7 @@ test("rounding_total_fractial", function () { config.free(); } }); -test("rounding_total_fractial_nested", function () { +test("rounding_total_fractial_nested", () => { const config = Yoga.Config.create(); let root; @@ -511,7 +511,7 @@ test("rounding_total_fractial_nested", function () { config.free(); } }); -test("rounding_fractial_input_1", function () { +test("rounding_fractial_input_1", () => { const config = Yoga.Config.create(); let root; @@ -586,7 +586,7 @@ test("rounding_fractial_input_1", function () { config.free(); } }); -test("rounding_fractial_input_2", function () { +test("rounding_fractial_input_2", () => { const config = Yoga.Config.create(); let root; @@ -661,7 +661,7 @@ test("rounding_fractial_input_2", function () { config.free(); } }); -test("rounding_fractial_input_3", function () { +test("rounding_fractial_input_3", () => { const config = Yoga.Config.create(); let root; @@ -737,7 +737,7 @@ test("rounding_fractial_input_3", function () { config.free(); } }); -test("rounding_fractial_input_4", function () { +test("rounding_fractial_input_4", () => { const config = Yoga.Config.create(); let root; @@ -813,7 +813,7 @@ test("rounding_fractial_input_4", function () { config.free(); } }); -test("rounding_inner_node_controversy_horizontal", function () { +test("rounding_inner_node_controversy_horizontal", () => { const config = Yoga.Config.create(); let root; @@ -902,7 +902,7 @@ test("rounding_inner_node_controversy_horizontal", function () { config.free(); } }); -test("rounding_inner_node_controversy_vertical", function () { +test("rounding_inner_node_controversy_vertical", () => { const config = Yoga.Config.create(); let root; @@ -990,7 +990,7 @@ test("rounding_inner_node_controversy_vertical", function () { config.free(); } }); -test("rounding_inner_node_controversy_combined", function () { +test("rounding_inner_node_controversy_combined", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index 69df93f4..6fa2c119 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -test("nested_overflowing_child", function () { +test("nested_overflowing_child", () => { const config = Yoga.Config.create(); let root; @@ -64,7 +64,7 @@ test("nested_overflowing_child", function () { config.free(); } }); -test("nested_overflowing_child_in_constraint_parent", function () { +test("nested_overflowing_child_in_constraint_parent", () => { const config = Yoga.Config.create(); let root; @@ -123,7 +123,7 @@ test("nested_overflowing_child_in_constraint_parent", function () { config.free(); } }); -test("parent_wrap_child_size_overflowing_parent", function () { +test("parent_wrap_child_size_overflowing_parent", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index 7263c833..57940928 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -10,20 +10,20 @@ require(`./tools`); -let fs = require(`fs`); -let vm = require(`vm`); +const fs = require(`fs`); +const vm = require(`vm`); -let WARMUP_ITERATIONS = 3; -let BENCHMARK_ITERATIONS = 10; +const WARMUP_ITERATIONS = 3; +const BENCHMARK_ITERATIONS = 10; -let testFiles = process.argv.slice(2).map((file) => { +const testFiles = process.argv.slice(2).map((file) => { return fs.readFileSync(file).toString(); }); -let testResults = new Map(); +const testResults = new Map(); -for (let type of ["asmjs", "wasm"]) { - for (let file of testFiles) { +for (const type of ["asmjs", "wasm"]) { + for (const file of testFiles) { vm.runInNewContext( file, Object.assign(Object.create(global), { @@ -38,11 +38,11 @@ for (let type of ["asmjs", "wasm"]) { for (let t = 0; t < WARMUP_ITERATIONS; ++t) fn(); - let start = Date.now(); + const start = Date.now(); for (let t = 0; t < BENCHMARK_ITERATIONS; ++t) fn(); - let end = Date.now(); + const end = Date.now(); testEntry.set(type, (end - start) / BENCHMARK_ITERATIONS); }, @@ -55,14 +55,14 @@ console.log( `Note: those tests are independants; there is no time relation to be expected between them` ); -for (let [name, results] of testResults) { +for (const [name, results] of testResults) { console.log(); - let min = Math.min(Infinity, ...results.values()); + const min = Math.min(Infinity, ...results.values()); console.log(name); - for (let [type, result] of results) { + for (const [type, result] of results) { console.log( ` - ${type}: ${result}ms (${Math.round((result / min) * 10000) / 100}%)` ); diff --git a/javascript/tests/tools.js b/javascript/tests/tools.js index b3820792..a72464ee 100644 --- a/javascript/tests/tools.js +++ b/javascript/tests/tools.js @@ -8,7 +8,7 @@ */ global.getMeasureCounter = function (Yoga, cb, staticWidth, staticHeight) { - var counter = 0; + let counter = 0; return { inc: function (width, widthMode, height, heightMode) { @@ -26,35 +26,29 @@ global.getMeasureCounter = function (Yoga, cb, staticWidth, staticHeight) { }; global.getMeasureCounterMax = function (Yoga) { - return getMeasureCounter( - Yoga, - function (width, widthMode, height, heightMode) { - var measuredWidth = - widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; + return getMeasureCounter(Yoga, (width, widthMode, height, heightMode) => { + const measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; + const measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; - return { width: measuredWidth, height: measuredHeight }; - } - ); + return { width: measuredWidth, height: measuredHeight }; + }); }; global.getMeasureCounterMin = function (Yoga) { - return getMeasureCounter( - Yoga, - function (width, widthMode, height, heightMode) { - var measuredWidth = - widthMode === Yoga.MEASURE_MODE_UNDEFINED || - (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) - ? 10 - : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED || - (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) - ? 10 - : height; + return getMeasureCounter(Yoga, (width, widthMode, height, heightMode) => { + const measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED || + (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) + ? 10 + : width; + const measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED || + (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) + ? 10 + : height; - return { width: measuredWidth, height: measuredHeight }; - } - ); + return { width: measuredWidth, height: measuredHeight }; + }); }; -- 2.50.1.windows.1 From 50ae0eee251adc0c790dbd20607e54d43c12652f Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 02:23:16 -0800 Subject: [PATCH 34/47] Avoid setup on JS lint job --- .github/workflows/validate-js.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml index a950d90f..544e0e71 100644 --- a/.github/workflows/validate-js.yml +++ b/.github/workflows/validate-js.yml @@ -53,8 +53,9 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup-js + - name: yarn install + run: yarn install --frozen-lockfile + working-directory: javascript - name: yarn lint run: yarn lint -- 2.50.1.windows.1 From c3ae0bdf932a8038f2071876daf2f8a85a6a1856 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 02:32:28 -0800 Subject: [PATCH 35/47] FORCE_COLOR --- .github/workflows/validate-js.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml index 544e0e71..1c43b563 100644 --- a/.github/workflows/validate-js.yml +++ b/.github/workflows/validate-js.yml @@ -7,6 +7,9 @@ on: - main workflow_dispatch: +env: + FORCE_COLOR: 3 + jobs: benchmark: name: Benchmark -- 2.50.1.windows.1 From fb68379deea24fc664c2323c86ce0d680865a0c9 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 02:57:00 -0800 Subject: [PATCH 36/47] remove COUNT --- enums.py | 1 - javascript/src_js/generated/YGEnums.js | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/enums.py b/enums.py index 26b605ca..d39bddba 100644 --- a/enums.py +++ b/enums.py @@ -227,7 +227,6 @@ with open(root + "/javascript/src_js/generated/YGEnums.js", "w") as f: f.write("module.exports = {\n") items = sorted(ENUMS.items()) for name, values in items: - f.write(" %s_COUNT: %s,\n" % (to_java_upper(name), len(values))) base = 0 for value in values: value_arg = value[0] if isinstance(value, tuple) else value diff --git a/javascript/src_js/generated/YGEnums.js b/javascript/src_js/generated/YGEnums.js index 6d7df977..b9a4cbde 100644 --- a/javascript/src_js/generated/YGEnums.js +++ b/javascript/src_js/generated/YGEnums.js @@ -8,7 +8,6 @@ // @generated by enums.py module.exports = { - ALIGN_COUNT: 8, ALIGN_AUTO: 0, ALIGN_FLEX_START: 1, ALIGN_CENTER: 2, @@ -18,20 +17,16 @@ module.exports = { ALIGN_SPACE_BETWEEN: 6, ALIGN_SPACE_AROUND: 7, - DIMENSION_COUNT: 2, DIMENSION_WIDTH: 0, DIMENSION_HEIGHT: 1, - DIRECTION_COUNT: 3, DIRECTION_INHERIT: 0, DIRECTION_LTR: 1, DIRECTION_RTL: 2, - DISPLAY_COUNT: 2, DISPLAY_FLEX: 0, DISPLAY_NONE: 1, - EDGE_COUNT: 9, EDGE_LEFT: 0, EDGE_TOP: 1, EDGE_RIGHT: 2, @@ -42,21 +37,17 @@ module.exports = { EDGE_VERTICAL: 7, EDGE_ALL: 8, - EXPERIMENTAL_FEATURE_COUNT: 1, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0, - FLEX_DIRECTION_COUNT: 4, FLEX_DIRECTION_COLUMN: 0, FLEX_DIRECTION_COLUMN_REVERSE: 1, FLEX_DIRECTION_ROW: 2, FLEX_DIRECTION_ROW_REVERSE: 3, - GUTTER_COUNT: 3, GUTTER_COLUMN: 0, GUTTER_ROW: 1, GUTTER_ALL: 2, - JUSTIFY_COUNT: 6, JUSTIFY_FLEX_START: 0, JUSTIFY_CENTER: 1, JUSTIFY_FLEX_END: 2, @@ -64,7 +55,6 @@ module.exports = { JUSTIFY_SPACE_AROUND: 4, JUSTIFY_SPACE_EVENLY: 5, - LOG_LEVEL_COUNT: 6, LOG_LEVEL_ERROR: 0, LOG_LEVEL_WARN: 1, LOG_LEVEL_INFO: 2, @@ -72,37 +62,30 @@ module.exports = { LOG_LEVEL_VERBOSE: 4, LOG_LEVEL_FATAL: 5, - MEASURE_MODE_COUNT: 3, MEASURE_MODE_UNDEFINED: 0, MEASURE_MODE_EXACTLY: 1, MEASURE_MODE_AT_MOST: 2, - NODE_TYPE_COUNT: 2, NODE_TYPE_DEFAULT: 0, NODE_TYPE_TEXT: 1, - OVERFLOW_COUNT: 3, OVERFLOW_VISIBLE: 0, OVERFLOW_HIDDEN: 1, OVERFLOW_SCROLL: 2, - POSITION_TYPE_COUNT: 3, POSITION_TYPE_STATIC: 0, POSITION_TYPE_RELATIVE: 1, POSITION_TYPE_ABSOLUTE: 2, - PRINT_OPTIONS_COUNT: 3, PRINT_OPTIONS_LAYOUT: 1, PRINT_OPTIONS_STYLE: 2, PRINT_OPTIONS_CHILDREN: 4, - UNIT_COUNT: 4, UNIT_UNDEFINED: 0, UNIT_POINT: 1, UNIT_PERCENT: 2, UNIT_AUTO: 3, - WRAP_COUNT: 3, WRAP_NO_WRAP: 0, WRAP_WRAP: 1, WRAP_WRAP_REVERSE: 2, -- 2.50.1.windows.1 From d8296b9190b57e27b02d0ea4a7424ff9a53ea752 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 05:57:36 -0800 Subject: [PATCH 37/47] Use a task runner for more granularity/parallelism --- javascript/.eslintrc.js | 3 +- javascript/jest.setup.js | 4 + javascript/just.config.js | 114 +++ javascript/package.json | 23 +- .../tests/Benchmarks/YGBenchmark.test.js | 1 - javascript/yarn.lock | 745 +++++++++++++++++- 6 files changed, 855 insertions(+), 35 deletions(-) create mode 100644 javascript/just.config.js diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js index 9a11938b..76439d7c 100644 --- a/javascript/.eslintrc.js +++ b/javascript/.eslintrc.js @@ -29,7 +29,7 @@ module.exports = { }, overrides: [ { - files: ["jest.*", "tests/**"], + files: ["jest.*", "just.config.js", "tests/**"], env: { node: true, }, @@ -38,6 +38,7 @@ module.exports = { getMeasureCounterMax: "writable", getMeasureCounterMin: "writable", Yoga: "writable", + YGBENCHMARK: "writable", }, }, ], diff --git a/javascript/jest.setup.js b/javascript/jest.setup.js index 9714c39f..b1bbfc79 100644 --- a/javascript/jest.setup.js +++ b/javascript/jest.setup.js @@ -18,3 +18,7 @@ module.exports = async () => { global.Yoga = await require("./dist/entrypoint/asmjs-async").loadYoga(); } }; + +Object.defineProperty(global, "YGBENCHMARK", { + get: () => global.test, +}); diff --git a/javascript/just.config.js b/javascript/just.config.js new file mode 100644 index 00000000..6b1eac8b --- /dev/null +++ b/javascript/just.config.js @@ -0,0 +1,114 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const { + copyTask, + jestTask, + parallel, + series, + spawn, + task, +} = require("just-scripts"); +const glob = require("glob"); +const which = require("which"); + +const cmake = which.sync("cmake"); +const encmake = which.sync("emcmake"); +const ninja = which.sync("ninja", { nothrow: true }); +const node = which.sync("node"); +const npx = which.sync("npx"); + +task( + "copy-dts", + copyTask({ + paths: ["./src_js/**/*.d.ts"], + dest: "./dist", + }) +); + +task("babel", () => + spawn(npx, ["babel", "src_js", "--source-maps", "--out-dir", "dist"]) +); + +task("cmake-generate", () => + spawn(encmake, [ + "cmake", + "-S", + ".", + "-B", + "build", + ...(ninja ? ["-G", "Ninja"] : []), + ]) +); + +task("prepare", parallel("copy-dts", "babel", "cmake-generate")); + +function cmakeBuildTask(targets) { + return () => + spawn( + cmake, + ["--build", "build", ...(targets ? ["--target", ...targets] : [])], + { stdio: "inherit" } + ); +} + +task("cmake-build:all", cmakeBuildTask()); +task("cmake-build:async", cmakeBuildTask(["asmjs-async", "wasm-async"])); +task("cmake-build:sync", cmakeBuildTask(["asmjs-sync", "wasm-sync"])); +task("cmake-build:asmjs-async", cmakeBuildTask(["asmjs-async"])); +task("cmake-build:asmjs-sync", cmakeBuildTask(["asmjs-sync"])); +task("cmake-build:wasm-async", cmakeBuildTask(["wasm-async"])); +task("cmake-build:wasm-sync", cmakeBuildTask(["wasm-sync"])); + +task("jest:asmjs-async", jestTask({ env: { WASM: false, SYNC: false } })); +task("jest:asmjs-sync", jestTask({ env: { WASM: false, SYNC: true } })); +task("jest:wasm-async", jestTask({ env: { WASM: true, SYNC: false } })); +task("jest:wasm-sync", jestTask({ env: { WASM: true, SYNC: true } })); + +task( + "test:asmjs-async", + series("prepare", "cmake-build:asmjs-async", "jest:asmjs-async") +); +task( + "test:asmjs-sync", + series("prepare", "cmake-build:asmjs-sync", "jest:asmjs-sync") +); +task( + "test:wasm-async", + series("prepare", "cmake-build:wasm-async", "jest:wasm-async") +); +task( + "test:wasm-sync", + series("prepare", "cmake-build:wasm-sync", "jest:wasm-sync") +); + +task("run-bench", () => + spawn( + node, + ["./tests/run-bench.js", ...glob.sync("./tests/Benchmarks/**/*.js")], + { stdio: "inherit" } + ) +); + +task("build", series("prepare", "cmake-build:all")); + +task( + "test", + series( + "prepare", + series( + series("cmake-build:asmjs-async", "jest:asmjs-async"), + series("cmake-build:asmjs-sync", "jest:asmjs-sync"), + series("cmake-build:wasm-async", "jest:wasm-async"), + series("cmake-build:wasm-sync", "jest:wasm-sync") + ) + ) +); + +task("benchmark", series("prepare", "cmake-build:sync", "run-bench")); diff --git a/javascript/package.json b/javascript/package.json index d5a47bf4..07bf3398 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -26,19 +26,15 @@ "src_js/**" ], "scripts": { - "benchmark": "yarn build && node tests/run-bench $(find tests/benchmarks -name '*.js')", - "build": "yarn build:js && yarn build:native", - "build:configure": "which ninja && emcmake cmake -S . -B build -G Ninja || emcmake cmake -S . -B build", - "build:copy-dts": "cd src_js && find . -name '*.d.ts' | cpio -pdm ../dist", - "build:js": "babel src_js --source-maps --out-dir dist && yarn build:copy-dts", - "build:native": "yarn build:configure && cmake --build build", + "benchmark": "just benchmark", + "build": "just build", "lint": "eslint .", "lint:fix": "yarn lint --fix", - "test": "yarn test:asmjs-async && yarn test:asmjs-sync && yarn test:wasm-async && yarn test:wasm-sync", - "test:asmjs-async": "yarn build --target asmjs-async && WASM=0 SYNC=0 jest", - "test:asmjs-sync": "yarn build --target asmjs-sync && WASM=0 SYNC=1 jest", - "test:wasm-async": "yarn build --target wasm-async && WASM=1 SYNC=0 jest", - "test:wasm-sync": "yarn build --target wasm-sync && WASM=1 SYNC=1 jest" + "test": "just test", + "test:asmjs-async": "just test:asmjs-async", + "test:asmjs-sync": "just test:asmjs-sync", + "test:wasm-async": "just test:wasm-async", + "test:wasm-sync": "just test:wasm-sync" }, "devDependencies": { "@babel/cli": "^7.20.7", @@ -49,7 +45,10 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-jest": "^27.1.7", "eslint-plugin-prettier": "^4.2.1", + "glob": "^8.0.3", "jest": "^29.3.1", - "prettier": "^2.4.1" + "just-scripts": "^2.1.0", + "prettier": "^2.4.1", + "which": "^3.0.0" } } diff --git a/javascript/tests/Benchmarks/YGBenchmark.test.js b/javascript/tests/Benchmarks/YGBenchmark.test.js index 5ca47071..d41bfe6c 100644 --- a/javascript/tests/Benchmarks/YGBenchmark.test.js +++ b/javascript/tests/Benchmarks/YGBenchmark.test.js @@ -6,7 +6,6 @@ */ const ITERATIONS = 2000; -const YGBENCHMARK = global.YGBENCHMARK ?? global.test; YGBENCHMARK("Stack with flex", () => { const root = Yoga.Node.create(); diff --git a/javascript/yarn.lock b/javascript/yarn.lock index 86066377..96c8c1c9 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -961,6 +961,11 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + "@eslint/eslintrc@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.0.tgz#8ec64e0df3e7a1971ee1ff5158da87389f167a63" @@ -1276,6 +1281,27 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@rushstack/node-core-library@3.53.3": + version "3.53.3" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.53.3.tgz#e78e0dc1545f6cd7d80b0408cf534aefc62fbbe2" + integrity sha512-H0+T5koi5MFhJUd5ND3dI3bwLhvlABetARl78L3lWftJVQEPyzcgTStvTTRiIM5mCltyTM8VYm6BuCtNUuxD0Q== + dependencies: + "@types/node" "12.20.24" + colors "~1.2.1" + fs-extra "~7.0.1" + import-lazy "~4.0.0" + jju "~1.4.0" + resolve "~1.17.0" + semver "~7.3.0" + z-schema "~5.0.2" + +"@rushstack/package-deps-hash@^3.2.5": + version "3.2.66" + resolved "https://registry.yarnpkg.com/@rushstack/package-deps-hash/-/package-deps-hash-3.2.66.tgz#1fc4f121500aa3670c4c5edf388722ffb001ddbd" + integrity sha512-LpsJZ8H7bmEvPEluw9/6Ucf92xiqomZ0P4RSw1YGABYfwt/eOGBYQ2VhyBJsfkQFTRBlIOGCy3GvwvRMRUKz+A== + dependencies: + "@rushstack/node-core-library" "3.53.3" + "@sinclair/typebox@^0.24.1": version "0.24.51" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" @@ -1364,6 +1390,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.17.tgz#5c009e1d9c38f4a2a9d45c0b0c493fe6cdb4bcb5" integrity sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng== +"@types/node@12.20.24": + version "12.20.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.24.tgz#c37ac69cb2948afb4cef95f424fa0037971a9a5c" + integrity sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ== + "@types/prettier@^2.1.5": version "2.7.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" @@ -1459,7 +1490,7 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^4.2.1: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -1490,7 +1521,12 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@^3.0.3: +ansicolors@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" + integrity sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg== + +anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -1498,14 +1534,6 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" -anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1518,11 +1546,88 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +arr-filter@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" + integrity sha512-A2BETWCqhsecSvCkWAeVBFLH6sXEUGASuzkpjL3GR1SlL/PWL6M3J8EAAld2Uubmh39tvkJTqC9LeLHCUKmFXA== + dependencies: + make-iterator "^1.0.0" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-map@^2.0.0, arr-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" + integrity sha512-tVqVTHt+Q5Xb09qRkbu+DidW1yYzz5izWS2Xm2yFm7qJnmUfz4HPzNxbHkdRJbz2lrqI7S+z17xNYdFcBBO8Hw== + dependencies: + make-iterator "^1.0.0" + +array-each@^1.0.0, array-each@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" + integrity sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA== + +array-initial@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" + integrity sha512-BC4Yl89vneCYfpLrs5JU2aAu9/a+xWbeKhvISg9PT7eWFB9UlRvI+rKEtk6mgxWr3dSkk9gQ8hCrdqt06NXPdw== + dependencies: + array-slice "^1.0.0" + is-number "^4.0.0" + +array-last@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" + integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== + dependencies: + is-number "^4.0.0" + +array-slice@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" + integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== + array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +async-done@^1.2.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" + integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.2" + process-nextick-args "^2.0.0" + stream-exhaust "^1.0.1" + +async-done@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/async-done/-/async-done-2.0.0.tgz#f1ec5df738c6383a52b0a30d0902fd897329c15a" + integrity sha512-j0s3bzYq9yKIVLKGE/tWlCpa3PfFLcrDZLTSVdnnCTGagXuXBJO4SsY9Xdk/fQBirCkH4evW5xOeJXqlAQFdsw== + dependencies: + end-of-stream "^1.4.4" + once "^1.4.0" + stream-exhaust "^1.0.2" + +async-settle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" + integrity sha512-VPXfB4Vk49z1LHHodrEQ6Xf7W4gg1w0dAPROHngx7qgDjqmIQ+fXmwgGXTW/ITLai0YLSvWepJOP9EVpMnEAcw== + dependencies: + async-done "^1.2.2" + +async-settle@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-2.0.0.tgz#c695ad14e070f6a755d019d32d6eb38029020287" + integrity sha512-Obu/KE8FurfQRN6ODdHN9LuXqwC+JFIM9NRyZqJJ4ZfLJmIYN9Rg0/kb+wF70VV5+fJusTMQlJ1t5rF7J/ETdg== + dependencies: + async-done "^2.0.0" + babel-jest@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" @@ -1607,6 +1712,30 @@ babel-preset-jest@^29.2.0: babel-plugin-jest-hoist "^29.2.0" babel-preset-current-node-syntax "^1.0.0" +bach@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" + integrity sha512-bZOOfCb3gXBXbTFXq3OZtGR88LwGeJvzu6szttaIzymOTS4ZttBNOWSv7aLZja2EMycKtRYV0Oa8SNKH/zkxvg== + dependencies: + arr-filter "^1.1.1" + arr-flatten "^1.0.1" + arr-map "^2.0.0" + array-each "^1.0.0" + array-initial "^1.0.0" + array-last "^1.1.1" + async-done "^1.2.2" + async-settle "^1.0.0" + now-and-later "^2.0.0" + +bach@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/bach/-/bach-2.0.1.tgz#45a3a3cbf7dbba3132087185c60357482b988972" + integrity sha512-A7bvGMGiTOxGMpNupYl9HQTf0FFDNF4VCmks4PJpFyN1AX2pdKuxuwdvUz2Hu388wcgp+OvGFNsumBfFNkR7eg== + dependencies: + async-done "^2.0.0" + async-settle "^2.0.0" + now-and-later "^3.0.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -1625,6 +1754,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -1674,6 +1810,14 @@ caniuse-lite@^1.0.30001400: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001441.tgz#987437b266260b640a23cd18fbddb509d7f69f3e" integrity sha512-OyxRR4Vof59I3yGWXws6i908EtGbMzVUi3ganaZQHmydk1iwDhRnvaPG2WaR0KcqrDFKrxVZHULT396LEPhXfg== +cardinal@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-2.1.1.tgz#7cc1055d822d212954d07b085dea251cc7bc5505" + integrity sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw== + dependencies: + ansicolors "~0.3.2" + redeyed "~2.1.0" + chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1683,7 +1827,7 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -1696,7 +1840,7 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -chokidar@^3.4.0: +chokidar@^3.4.0, chokidar@^3.5.2: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -1711,6 +1855,11 @@ chokidar@^3.4.0: optionalDependencies: fsevents "~2.3.2" +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== + ci-info@^3.2.0: version "3.7.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef" @@ -1721,6 +1870,24 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== +cli-table3@^0.6.0: + version "0.6.3" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" + integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -1730,6 +1897,15 @@ cliui@^8.0.1: strip-ansi "^6.0.1" wrap-ansi "^7.0.0" +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1740,6 +1916,15 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== +collection-map@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" + integrity sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA== + dependencies: + arr-map "^2.0.2" + for-own "^1.0.0" + make-iterator "^1.0.0" + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -1764,11 +1949,21 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colors@~1.2.1: + version "1.2.5" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc" + integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg== + commander@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" + integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1800,6 +1995,14 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -1822,11 +2025,21 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== +default-resolution@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" + integrity sha512-2xaP6GiwVwOEbXCGoJ4ufgC76m8cj805jrghScewJC2ZDsb9U0b4BIrba+xt/Uytyd0HvQ6+WymSRTfnYj59GQ== + detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== +diff-match-patch@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.5.tgz#abb584d5f10cd1196dfc55aa03701592ae3f7b37" + integrity sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw== + diff-sequences@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" @@ -1861,6 +2074,13 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +end-of-stream@^1.1.0, end-of-stream@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1868,6 +2088,42 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50: + version "0.10.62" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" + integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== + dependencies: + es6-iterator "^2.0.3" + es6-symbol "^3.1.3" + next-tick "^1.1.0" + +es6-iterator@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +es6-weak-map@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1994,7 +2250,7 @@ espree@^9.4.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" -esprima@^4.0.0: +esprima@^4.0.0, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -2059,6 +2315,13 @@ expect@^29.3.1: jest-message-util "^29.3.1" jest-util "^29.3.1" +ext@^1.1.2: + version "1.7.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" + integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== + dependencies: + type "^2.7.2" + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -2085,6 +2348,11 @@ fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-levenshtein@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" + integrity sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw== + fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -2147,6 +2415,43 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== + +for-own@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg== + dependencies: + for-in "^1.0.1" + +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-extra@~7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== + dependencies: + minipass "^3.0.0" + fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -2213,6 +2518,17 @@ glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" + integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -2237,7 +2553,7 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -2287,6 +2603,11 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" +import-lazy@~4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" + integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw== + import-local@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" @@ -2354,6 +2675,11 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" @@ -2364,6 +2690,13 @@ is-path-inside@^3.0.3: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -2374,6 +2707,11 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" @@ -2777,6 +3115,11 @@ jest@^29.3.1: import-local "^3.0.2" jest-cli "^29.3.1" +jju@^1.4.0, jju@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" + integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA== + js-sdsl@^4.1.4: version "4.2.0" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0" @@ -2832,11 +3175,96 @@ json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +"just-scripts-utils@>=1.2.0 <2.0.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/just-scripts-utils/-/just-scripts-utils-1.2.0.tgz#232a768a1083626e47c29c749e33d964ee027d56" + integrity sha512-rJMNtMz4V6uyMyfx+a2CqdMh1X/C9cVJTOPegvEzSonYMOKsiZEw2L9VzKVIFwNteKGZT6D2hFjSMAle41MAgA== + dependencies: + fs-extra "^10.0.0" + glob "^7.1.3" + jju "^1.4.0" + just-task-logger ">=1.2.0 <2.0.0" + marked "^4.0.12" + marked-terminal "^4.1.0" + semver "^7.0.0" + tar "^6.1.9" + yargs "^16.2.0" + +just-scripts@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/just-scripts/-/just-scripts-2.1.0.tgz#af60d3412f71b8fba4092c9a7596bd496e385d77" + integrity sha512-uaLUc92l1YeE8OiKT2RWU666KzJWWkoY6Gg4p1m5ctqgG51gjz9AsLeuoqCUaj5+n7/BIjD8PhtMoYi+F4nrKw== + dependencies: + chalk "^4.0.0" + diff-match-patch "1.0.5" + fs-extra "^10.0.0" + glob "^7.1.3" + just-scripts-utils ">=1.2.0 <2.0.0" + just-task ">=1.7.0 <2.0.0" + prompts "^2.4.0" + run-parallel-limit "^1.0.6" + semver "^7.0.0" + supports-color "^8.1.0" + webpack-merge "^5.7.3" + +"just-task-logger@>=1.2.0 <2.0.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/just-task-logger/-/just-task-logger-1.2.0.tgz#7467a6d24cce054e76fcfb7ebe2e44bdb629d05e" + integrity sha512-pa5FfJMiJ11KgCXDSfnbu/Enoiwm3ReOrSO9tP0CK69/yYtfsDhE8g6S0v6cCdDYGa4zpVkX7E4G1u3L7lAPTw== + dependencies: + chalk "^4.0.0" + yargs "^16.2.0" + +"just-task@>=1.7.0 <2.0.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/just-task/-/just-task-1.7.0.tgz#ff646352e92c80b45c1e0a7133103337136d512c" + integrity sha512-1+meiNd3HEwvzRro+P4jtgS2rz1lAHe4hbGMAfrjEtXjCoK6n6VCQnLccfyuMRTj/f0DA61wMH51MQwjujYjoQ== + dependencies: + "@rushstack/package-deps-hash" "^3.2.5" + bach "^2.0.0" + chalk "^4.0.0" + chokidar "^3.5.2" + fs-extra "^10.0.0" + just-task-logger ">=1.2.0 <2.0.0" + resolve "^1.19.0" + undertaker "^1.3.0" + undertaker-registry "^2.0.0" + yargs-parser "^20.2.3" + +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +last-run@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" + integrity sha512-U/VxvpX4N/rFvPzr3qG5EtLKEnNI0emvIQB3/ecEwv+8GHaUKbIB8vxv1Oai5FAF0d0r7LXHhLLe5K/yChm5GQ== + dependencies: + default-resolution "^2.0.0" + es6-weak-map "^2.0.1" + leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -2874,11 +3302,26 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -2908,6 +3351,13 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-iterator@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" + integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== + dependencies: + kind-of "^6.0.2" + makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -2915,6 +3365,23 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +marked-terminal@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-4.2.0.tgz#593734a53cf9a4bb01ea961aa579bd21889ce502" + integrity sha512-DQfNRV9svZf0Dm9Cf5x5xaVJ1+XjxQW6XjFJ5HFkVyK52SDpj5PCBzS5X5r2w9nHr3mlB0T5201UMLue9fmhUw== + dependencies: + ansi-escapes "^4.3.1" + cardinal "^2.1.1" + chalk "^4.1.0" + cli-table3 "^0.6.0" + node-emoji "^1.10.0" + supports-hyperlinks "^2.1.0" + +marked@^4.0.12: + version "4.2.5" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.5.tgz#979813dfc1252cc123a79b71b095759a32f42a5d" + integrity sha512-jPueVhumq7idETHkb203WDD4fMA3yV9emQ5vLwop58lu8bTclMghBWcYAavlDqIEMaisADinV1TooIFCfqOsYQ== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -2945,6 +3412,40 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" + integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== + dependencies: + brace-expansion "^2.0.1" + +minipass@^3.0.0: + version "3.3.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" + integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== + dependencies: + yallist "^4.0.0" + +minipass@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.0.0.tgz#7cebb0f9fa7d56f0c5b17853cbe28838a8dbbd3b" + integrity sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw== + dependencies: + yallist "^4.0.0" + +minizlib@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + +mkdirp@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2955,6 +3456,18 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +next-tick@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + +node-emoji@^1.10.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" + integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A== + dependencies: + lodash "^4.17.21" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -2970,6 +3483,20 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +now-and-later@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" + integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== + dependencies: + once "^1.3.2" + +now-and-later@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-3.0.0.tgz#cdc045dc5b894b35793cf276cc3206077bb7302d" + integrity sha512-pGO4pzSdaxhWTGkfSfHx3hVzJVslFPwBp2Myq9MYN/ChfJZF87ochMAXnvz6/58RJSf5ik2q9tXprBBrk2cpcg== + dependencies: + once "^1.4.0" + npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -2977,7 +3504,25 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -once@^1.3.0: +object.defaults@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" + integrity sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA== + dependencies: + array-each "^1.0.1" + array-slice "^1.0.0" + for-own "^1.0.0" + isobject "^3.0.0" + +object.reduce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" + integrity sha512-naLhxxpUESbNkRqc35oQ2scZSJueHGQNUfMW/0U37IgN6tE2dgDWg3whf+NEliy3F/QysrO48XKUz/nGPe+AQw== + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + +once@^1.3.0, once@^1.3.2, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== @@ -3068,7 +3613,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.7: +path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -3131,7 +3676,12 @@ pretty-format@^29.3.1: ansi-styles "^5.0.0" react-is "^18.0.0" -prompts@^2.0.1: +process-nextick-args@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +prompts@^2.0.1, prompts@^2.4.0: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== @@ -3161,6 +3711,13 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +redeyed@~2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-2.1.1.tgz#8984b5815d99cb220469c99eeeffe38913e6cc0b" + integrity sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ== + dependencies: + esprima "~4.0.0" + regenerate-unicode-properties@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" @@ -3241,7 +3798,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.14.2, resolve@^1.20.0: +resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -3250,6 +3807,13 @@ resolve@^1.14.2, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@~1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -3262,6 +3826,13 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +run-parallel-limit@^1.0.6: + version "1.1.0" + resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" + integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== + dependencies: + queue-microtask "^1.2.2" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -3279,13 +3850,20 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.5, semver@^7.3.7: +semver@^7.0.0, semver@^7.3.5, semver@^7.3.7, semver@~7.3.0: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3343,6 +3921,11 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" +stream-exhaust@^1.0.1, stream-exhaust@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" + integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== + string-length@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" @@ -3389,25 +3972,45 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.1.0: +supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" -supports-color@^8.0.0: +supports-color@^8.0.0, supports-color@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" +supports-hyperlinks@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" + integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA== + dependencies: + has-flag "^4.0.0" + supports-color "^7.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +tar@^6.1.9: + version "6.1.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b" + integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^4.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -3473,6 +4076,42 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.7.2: + version "2.7.2" + resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" + integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== + +undertaker-registry@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" + integrity sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw== + +undertaker-registry@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-2.0.0.tgz#d434246e398444740dd7fe4c9543e402ad99e4ca" + integrity sha512-+hhVICbnp+rlzZMgxXenpvTxpuvA67Bfgtt+O9WOE5jo7w/dyiF1VmoZVIHvP2EkUjsyKyTwYKlLhA+j47m1Ew== + +undertaker@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" + integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== + dependencies: + arr-flatten "^1.0.1" + arr-map "^2.0.0" + bach "^1.0.0" + collection-map "^1.0.0" + es6-weak-map "^2.0.1" + fast-levenshtein "^1.0.0" + last-run "^1.1.0" + object.defaults "^1.0.0" + object.reduce "^1.0.0" + undertaker-registry "^1.0.0" + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" @@ -3496,6 +4135,16 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + update-browserslist-db@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" @@ -3520,6 +4169,11 @@ v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" +validator@^13.7.0: + version "13.7.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" + integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== + walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" @@ -3527,6 +4181,14 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" +webpack-merge@^5.7.3: + version "5.8.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" + integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== + dependencies: + clone-deep "^4.0.1" + wildcard "^2.0.0" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -3534,6 +4196,18 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +which@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/which/-/which-3.0.0.tgz#a9efd016db59728758a390d23f1687b6e8f59f8e" + integrity sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ== + dependencies: + isexe "^2.0.0" + +wildcard@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== + word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -3576,11 +4250,29 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yargs-parser@^20.2.2, yargs-parser@^20.2.3: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yargs@^17.3.1: version "17.6.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" @@ -3598,3 +4290,14 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +z-schema@~5.0.2: + version "5.0.5" + resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-5.0.5.tgz#6805a48c5366a6125cae0e58752babfd503daf32" + integrity sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q== + dependencies: + lodash.get "^4.4.2" + lodash.isequal "^4.5.0" + validator "^13.7.0" + optionalDependencies: + commander "^9.4.1" -- 2.50.1.windows.1 From 25eb6bc960c8bb4a6f0abb03167a2a87f8055785 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 07:11:57 -0800 Subject: [PATCH 38/47] Refine tasks --- javascript/just.config.js | 86 +++++++++++++++------------------------ 1 file changed, 33 insertions(+), 53 deletions(-) diff --git a/javascript/just.config.js b/javascript/just.config.js index 6b1eac8b..424717fa 100644 --- a/javascript/just.config.js +++ b/javascript/just.config.js @@ -19,25 +19,19 @@ const glob = require("glob"); const which = require("which"); const cmake = which.sync("cmake"); -const encmake = which.sync("emcmake"); +const emcmake = which.sync("emcmake"); const ninja = which.sync("ninja", { nothrow: true }); const node = which.sync("node"); const npx = which.sync("npx"); -task( - "copy-dts", - copyTask({ - paths: ["./src_js/**/*.d.ts"], - dest: "./dist", - }) -); +task("copy-dts", copyTask({ paths: ["./src_js/**/*.d.ts"], dest: "./dist" })); task("babel", () => spawn(npx, ["babel", "src_js", "--source-maps", "--out-dir", "dist"]) ); task("cmake-generate", () => - spawn(encmake, [ + spawn(emcmake, [ "cmake", "-S", ".", @@ -47,7 +41,15 @@ task("cmake-generate", () => ]) ); -task("prepare", parallel("copy-dts", "babel", "cmake-generate")); +function prepareTask() { + return parallel("cmake-generate", "copy-dts", "babel"); +} + +function runBenchTask() { + const files = glob.sync("./tests/Benchmarks/**/*.js"); + return () => + spawn(node, ["./tests/run-bench.js", ...files], { stdio: "inherit" }); +} function cmakeBuildTask(targets) { return () => @@ -58,57 +60,35 @@ function cmakeBuildTask(targets) { ); } +function buildFlavor(flavor, env) { + task(`cmake-build:${flavor}`, cmakeBuildTask([flavor])); + task(`jest:${flavor}`, jestTask({ env })); + task( + `test:${flavor}`, + series(prepareTask(), `cmake-build:${flavor}`, `jest:${flavor}`) + ); +} + +buildFlavor("asmjs-async", { WASM: 0, SYNC: 0 }); +buildFlavor("asmjs-sync", { WASM: 0, SYNC: 1 }); +buildFlavor("wasm-async", { WASM: 1, SYNC: 0 }); +buildFlavor("wasm-sync", { WASM: 1, SYNC: 1 }); + task("cmake-build:all", cmakeBuildTask()); task("cmake-build:async", cmakeBuildTask(["asmjs-async", "wasm-async"])); task("cmake-build:sync", cmakeBuildTask(["asmjs-sync", "wasm-sync"])); -task("cmake-build:asmjs-async", cmakeBuildTask(["asmjs-async"])); -task("cmake-build:asmjs-sync", cmakeBuildTask(["asmjs-sync"])); -task("cmake-build:wasm-async", cmakeBuildTask(["wasm-async"])); -task("cmake-build:wasm-sync", cmakeBuildTask(["wasm-sync"])); -task("jest:asmjs-async", jestTask({ env: { WASM: false, SYNC: false } })); -task("jest:asmjs-sync", jestTask({ env: { WASM: false, SYNC: true } })); -task("jest:wasm-async", jestTask({ env: { WASM: true, SYNC: false } })); -task("jest:wasm-sync", jestTask({ env: { WASM: true, SYNC: true } })); - -task( - "test:asmjs-async", - series("prepare", "cmake-build:asmjs-async", "jest:asmjs-async") -); -task( - "test:asmjs-sync", - series("prepare", "cmake-build:asmjs-sync", "jest:asmjs-sync") -); -task( - "test:wasm-async", - series("prepare", "cmake-build:wasm-async", "jest:wasm-async") -); -task( - "test:wasm-sync", - series("prepare", "cmake-build:wasm-sync", "jest:wasm-sync") -); - -task("run-bench", () => - spawn( - node, - ["./tests/run-bench.js", ...glob.sync("./tests/Benchmarks/**/*.js")], - { stdio: "inherit" } - ) -); - -task("build", series("prepare", "cmake-build:all")); +task("build", series(prepareTask(), "cmake-build:all")); task( "test", series( - "prepare", - series( - series("cmake-build:asmjs-async", "jest:asmjs-async"), - series("cmake-build:asmjs-sync", "jest:asmjs-sync"), - series("cmake-build:wasm-async", "jest:wasm-async"), - series("cmake-build:wasm-sync", "jest:wasm-sync") - ) + prepareTask(), + series("cmake-build:asmjs-async", "jest:asmjs-async"), + series("cmake-build:asmjs-sync", "jest:asmjs-sync"), + series("cmake-build:wasm-async", "jest:wasm-async"), + series("cmake-build:wasm-sync", "jest:wasm-sync") ) ); -task("benchmark", series("prepare", "cmake-build:sync", "run-bench")); +task("benchmark", series(prepareTask(), "cmake-build:sync", runBenchTask())); -- 2.50.1.windows.1 From cb4e9492eabfd888ebfa0fabae383a6414ca0f58 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 07:16:48 -0800 Subject: [PATCH 39/47] Add emsdk requirement --- javascript/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/javascript/README.md b/javascript/README.md index e103a9d4..7d53f143 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -52,6 +52,7 @@ import { loadYoga } from "yoga-layout/entrypoint/wasm-async"; ### Requirements +1. Emscripten SDK 1. CMake >= 3.13 1. (Optional) ninja, for faster builds -- 2.50.1.windows.1 From de9db1bc031c9a0c471de0457a9550a09bf3ef4f Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 08:17:17 -0800 Subject: [PATCH 40/47] Add missing config bindings --- javascript/README.md | 2 +- javascript/src_js/wrapAsm.d.ts | 14 ++++++++++---- javascript/src_native/Config.cc | 16 ++++++++++++++++ javascript/src_native/Config.hh | 4 ++++ javascript/src_native/embind.cc | 6 +++++- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/javascript/README.md b/javascript/README.md index 7d53f143..6f7b4d1a 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -44,7 +44,7 @@ For better performance and smaller packages, WebAssembly is preferred to asm.js A specific entrypoint may be specified on platforms which do not understand export conditions. ```ts -import { loadYoga } from "yoga-layout/entrypoint/wasm-async"; +import { loadYoga } from "yoga-layout/dist/entrypoint/wasm-async"; ``` diff --git a/javascript/src_js/wrapAsm.d.ts b/javascript/src_js/wrapAsm.d.ts index 805ac812..cca5026e 100644 --- a/javascript/src_js/wrapAsm.d.ts +++ b/javascript/src_js/wrapAsm.d.ts @@ -43,19 +43,25 @@ type Value = { } export type Config = { + free(): void; isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean, setExperimentalFeatureEnabled( feature: ExperimentalFeature, enabled: boolean, ): void, setPointScaleFactor(factor: number): void, + useLegacyStretchBehaviour(): boolean, + setUseLegacyStretchBehaviour(useLegacyStretchBehaviour: boolean): void, + useWebDefaults(): boolean, + setUseWebDefaults(useWebDefaults): void, }; export type MeasureFunction = ( - width: number, - widthMode: number, - height: number, - heightMode: number) => Size; + width: number, + widthMode: number, + height: number, + heightMode: number +) => Size; export type Node = { calculateLayout( diff --git a/javascript/src_native/Config.cc b/javascript/src_native/Config.cc index a23aa20f..3824f519 100644 --- a/javascript/src_native/Config.cc +++ b/javascript/src_native/Config.cc @@ -32,7 +32,23 @@ void Config::setPointScaleFactor(float pixelsInPoint) { YGConfigSetPointScaleFactor(m_config, pixelsInPoint); } +void Config::setUseLegacyStretchBehaviour(bool useLegacyStretchBehaviour) { + YGConfigSetUseLegacyStretchBehaviour(m_config, useLegacyStretchBehaviour); +} + +void Config::setUseWebDefaults(bool useWebDefaults) { + YGConfigSetUseWebDefaults(m_config, useWebDefaults); +} + bool Config::isExperimentalFeatureEnabled(int feature) const { return YGConfigIsExperimentalFeatureEnabled( m_config, static_cast(feature)); } + +bool Config::useLegacyStretchBehaviour() { + return YGConfigGetUseLegacyStretchBehaviour(m_config); +} + +bool Config::useWebDefaults() { + return YGConfigGetUseWebDefaults(m_config); +} diff --git a/javascript/src_native/Config.hh b/javascript/src_native/Config.hh index 8b082b33..ccebfa67 100644 --- a/javascript/src_native/Config.hh +++ b/javascript/src_native/Config.hh @@ -32,9 +32,13 @@ public: // Prevent accidental copy public: // Setters void setExperimentalFeatureEnabled(int feature, bool enabled); void setPointScaleFactor(float pixelsInPoint); + void setUseLegacyStretchBehaviour(bool useLegacyStretchBehaviour); + void setUseWebDefaults(bool useWebDefaults); public: // Getters bool isExperimentalFeatureEnabled(int feature) const; + bool useLegacyStretchBehaviour(); + bool useWebDefaults(); private: YGConfigRef m_config; diff --git a/javascript/src_native/embind.cc b/javascript/src_native/embind.cc index 96d6b018..cb5d8056 100644 --- a/javascript/src_native/embind.cc +++ b/javascript/src_native/embind.cc @@ -32,9 +32,13 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) { "setExperimentalFeatureEnabled", &Config::setExperimentalFeatureEnabled) .function("setPointScaleFactor", &Config::setPointScaleFactor) + .function("setUseLegacyStretchBehaviour", &Config::setUseLegacyStretchBehaviour) + .function("setUseWebDefaults", &Config::setUseWebDefaults) .function( "isExperimentalFeatureEnabled", - &Config::isExperimentalFeatureEnabled); + &Config::isExperimentalFeatureEnabled) + .function("useLegacyStretchBehaviour", &Config::useLegacyStretchBehaviour) + .function("useWebDefaults", &Config::useWebDefaults); value_object("Layout") .field("left", &Layout::left) -- 2.50.1.windows.1 From 466333ed1469cc2375a577f64b0a3f413e7878e7 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 21:26:47 -0800 Subject: [PATCH 41/47] Try adding Windows --- .github/workflows/validate-android.yml | 5 +++-- .github/workflows/validate-apple.yml | 8 ++++---- .github/workflows/validate-js.yml | 21 +++++++++++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/validate-android.yml b/.github/workflows/validate-android.yml index 4935fb27..d0c7081d 100644 --- a/.github/workflows/validate-android.yml +++ b/.github/workflows/validate-android.yml @@ -9,11 +9,12 @@ on: jobs: build: - name: Build (${{ matrix.mode }}) - runs-on: ubuntu-latest + name: Build [${{ matrix.mode }}][${{ matrix.os }}] + runs-on: ${{ matrix.os }} strategy: matrix: mode: [Debug, Release] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/validate-apple.yml b/.github/workflows/validate-apple.yml index 3f90e67d..3b569812 100644 --- a/.github/workflows/validate-apple.yml +++ b/.github/workflows/validate-apple.yml @@ -10,7 +10,6 @@ on: jobs: lint-pods: name: Lint - if: ${{ false }} # Apple Build is Broken runs-on: macos-latest steps: @@ -21,10 +20,10 @@ jobs: - name: pod spec lint run: pod spec lint --verbose + continue-on-error: true # Apple Build is Broken build-sample: - name: Build (${{ matrix.mode }}) - if: ${{ false }} # Apple Build is Broken + name: Build [${{ matrix.mode }}] runs-on: macos-latest strategy: matrix: @@ -37,8 +36,9 @@ jobs: uses: ./.github/actions/setup-apple - name: pod install - working-directory: ./YogaKit/YogaKitSample run: pod install + working-directory: ./YogaKit/YogaKitSample + continue-on-error: true # Apple Build is Broken # TODO: xcodebuild diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml index 1c43b563..2b856906 100644 --- a/.github/workflows/validate-js.yml +++ b/.github/workflows/validate-js.yml @@ -12,8 +12,11 @@ env: jobs: benchmark: - name: Benchmark - runs-on: ubuntu-latest + name: Benchmark [${{ matrix.os }}] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 @@ -25,8 +28,11 @@ jobs: working-directory: javascript build: - name: Build - runs-on: ubuntu-latest + name: Build [${{ matrix.os }}] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 @@ -38,8 +44,11 @@ jobs: working-directory: javascript test: - name: Test - runs-on: ubuntu-latest + name: Test [${{ matrix.os }}] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 -- 2.50.1.windows.1 From a14e422961247f301d4ba6e234738229790903db Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 23:05:04 -0800 Subject: [PATCH 42/47] Integrate clang-format into JS lint steps --- .github/actions/clang-format/action.yml | 4 +- .github/workflows/validate-cpp.yml | 5 - javascript/.eslintrc.js | 2 +- javascript/just.config.js | 143 ++++++++++++++++-------- javascript/package.json | 5 +- javascript/src_native/embind.cc | 6 +- javascript/yarn.lock | 18 ++- 7 files changed, 121 insertions(+), 62 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 79508a14..8d9a57a3 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -19,6 +19,6 @@ runs: working-directory: ${{ inputs.directory }} shell: bash run: | - shopt -s globstar + shopt -s extglob shopt -s nullglob - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.cc **/*.h **/*.hh **/*.m **/*.mm + clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm} diff --git a/.github/workflows/validate-cpp.yml b/.github/workflows/validate-cpp.yml index 121bdb41..3f4b4e7a 100644 --- a/.github/workflows/validate-cpp.yml +++ b/.github/workflows/validate-cpp.yml @@ -19,8 +19,3 @@ jobs: uses: ./.github/actions/clang-format with: directory: ./yoga - - - name: clang-format (JavaScript Bindings) - uses: ./.github/actions/clang-format - with: - directory: ./javascript diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js index 76439d7c..6cedc194 100644 --- a/javascript/.eslintrc.js +++ b/javascript/.eslintrc.js @@ -8,7 +8,7 @@ */ module.exports = { - ignorePatterns: ["dist/**"], + ignorePatterns: ["dist/**", "**/*.d.ts"], parser: "@babel/eslint-parser", extends: [ "eslint:recommended", diff --git a/javascript/just.config.js b/javascript/just.config.js index 424717fa..b221a090 100644 --- a/javascript/just.config.js +++ b/javascript/just.config.js @@ -8,82 +8,58 @@ */ const { + argv, copyTask, + eslintTask, + logger, jestTask, + option, parallel, series, spawn, task, } = require("just-scripts"); + const glob = require("glob"); const which = require("which"); -const cmake = which.sync("cmake"); -const emcmake = which.sync("emcmake"); -const ninja = which.sync("ninja", { nothrow: true }); -const node = which.sync("node"); -const npx = which.sync("npx"); +const node = process.execPath; -task("copy-dts", copyTask({ paths: ["./src_js/**/*.d.ts"], dest: "./dist" })); +option("fix"); -task("babel", () => - spawn(npx, ["babel", "src_js", "--source-maps", "--out-dir", "dist"]) +task( + "prepare-for-build", + parallel( + babelTransformTask({ paths: ["src_js"], dest: "dist" }), + copyTask({ paths: ["src_js/**/*.d.ts"], dest: "dist" }), + emcmakeGenerateTask() + ) ); -task("cmake-generate", () => - spawn(emcmake, [ - "cmake", - "-S", - ".", - "-B", - "build", - ...(ninja ? ["-G", "Ninja"] : []), - ]) -); - -function prepareTask() { - return parallel("cmake-generate", "copy-dts", "babel"); -} - -function runBenchTask() { - const files = glob.sync("./tests/Benchmarks/**/*.js"); - return () => - spawn(node, ["./tests/run-bench.js", ...files], { stdio: "inherit" }); -} - -function cmakeBuildTask(targets) { - return () => - spawn( - cmake, - ["--build", "build", ...(targets ? ["--target", ...targets] : [])], - { stdio: "inherit" } - ); -} - -function buildFlavor(flavor, env) { +function defineFlavor(flavor, env) { task(`cmake-build:${flavor}`, cmakeBuildTask([flavor])); task(`jest:${flavor}`, jestTask({ env })); task( `test:${flavor}`, - series(prepareTask(), `cmake-build:${flavor}`, `jest:${flavor}`) + series("prepare-for-build", `cmake-build:${flavor}`, `jest:${flavor}`) ); } -buildFlavor("asmjs-async", { WASM: 0, SYNC: 0 }); -buildFlavor("asmjs-sync", { WASM: 0, SYNC: 1 }); -buildFlavor("wasm-async", { WASM: 1, SYNC: 0 }); -buildFlavor("wasm-sync", { WASM: 1, SYNC: 1 }); +defineFlavor("asmjs-async", { WASM: 0, SYNC: 0 }); +defineFlavor("asmjs-sync", { WASM: 0, SYNC: 1 }); +defineFlavor("wasm-async", { WASM: 1, SYNC: 0 }); +defineFlavor("wasm-sync", { WASM: 1, SYNC: 1 }); task("cmake-build:all", cmakeBuildTask()); task("cmake-build:async", cmakeBuildTask(["asmjs-async", "wasm-async"])); task("cmake-build:sync", cmakeBuildTask(["asmjs-sync", "wasm-sync"])); -task("build", series(prepareTask(), "cmake-build:all")); +task("build", series("prepare-for-build", "cmake-build:all")); task( "test", series( - prepareTask(), + "prepare-for-build", series("cmake-build:asmjs-async", "jest:asmjs-async"), series("cmake-build:asmjs-sync", "jest:asmjs-sync"), series("cmake-build:wasm-async", "jest:wasm-async"), @@ -91,4 +67,77 @@ task( ) ); -task("benchmark", series(prepareTask(), "cmake-build:sync", runBenchTask())); +task( + "benchmark", + series("prepare-for-build", "cmake-build:sync", runBenchTask()) +); + +task( + "lint", + series(eslintTask({ fix: argv().fix }), clangFormatTask({ fix: argv().fix })) +); + +function babelTransformTask(opts) { + return () => { + const args = [...opts.paths, "--source-maps", "--out-dir", opts.dest]; + logger.info(`Transforming [${opts.paths.join(",")}] to '${opts.dest}'`); + + return spawn(node, [require.resolve("@babel/cli/bin/babel"), ...args]); + }; +} + +function runBenchTask() { + return () => { + const files = glob.sync("./tests/Benchmarks/**/*.js"); + const args = ["./tests/run-bench.js", ...files]; + logger.info(args.join(" ")); + + return spawn(node, args, { stdio: "inherit" }); + }; +} + +function emcmakeGenerateTask() { + return () => { + const emcmake = which.sync("emcmake"); + const ninja = which.sync("ninja", { nothrow: true }); + const args = [ + "cmake", + "-S", + ".", + "-B", + "build", + ...(ninja ? ["-G", "Ninja"] : []), + ]; + logger.info(["encmake", ...args].join(" ")); + + return spawn(emcmake, args); + }; +} + +function cmakeBuildTask(targets) { + return () => { + const cmake = which.sync("cmake"); + const args = [ + "--build", + "build", + ...(targets ? ["--target", ...targets] : []), + ]; + logger.info(["cmake", ...args].join(" ")); + + return spawn(cmake, args, { stdio: "inherit" }); + }; +} + +function clangFormatTask(opts) { + return () => { + const args = [ + ...(opts.fix ? ["-i"] : ["--dry-run", "--Werror"]), + ...glob.sync("**/*.{h,hh,hpp,c,cpp,cc,m,mm}"), + ]; + logger.info(["clang-format", ...args].join(" ")); + + return spawn(node, [require.resolve("clang-format"), ...args], { + stdio: "inherit", + }); + }; +} diff --git a/javascript/package.json b/javascript/package.json index 07bf3398..201542f2 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -28,8 +28,8 @@ "scripts": { "benchmark": "just benchmark", "build": "just build", - "lint": "eslint .", - "lint:fix": "yarn lint --fix", + "lint": "just lint", + "lint:fix": "just lint --fix", "test": "just test", "test:asmjs-async": "just test:asmjs-async", "test:asmjs-sync": "just test:asmjs-sync", @@ -41,6 +41,7 @@ "@babel/core": "^7.20.7", "@babel/eslint-parser": "^7.19.1", "@babel/preset-env": "^7.20.2", + "clang-format": "^1.8.0", "eslint": "^8.30.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jest": "^27.1.7", diff --git a/javascript/src_native/embind.cc b/javascript/src_native/embind.cc index cb5d8056..91e6afc3 100644 --- a/javascript/src_native/embind.cc +++ b/javascript/src_native/embind.cc @@ -32,11 +32,11 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) { "setExperimentalFeatureEnabled", &Config::setExperimentalFeatureEnabled) .function("setPointScaleFactor", &Config::setPointScaleFactor) - .function("setUseLegacyStretchBehaviour", &Config::setUseLegacyStretchBehaviour) + .function( + "setUseLegacyStretchBehaviour", &Config::setUseLegacyStretchBehaviour) .function("setUseWebDefaults", &Config::setUseWebDefaults) .function( - "isExperimentalFeatureEnabled", - &Config::isExperimentalFeatureEnabled) + "isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled) .function("useLegacyStretchBehaviour", &Config::useLegacyStretchBehaviour) .function("useWebDefaults", &Config::useWebDefaults); diff --git a/javascript/yarn.lock b/javascript/yarn.lock index 96c8c1c9..0cfd027e 100644 --- a/javascript/yarn.lock +++ b/javascript/yarn.lock @@ -1628,6 +1628,11 @@ async-settle@^2.0.0: dependencies: async-done "^2.0.0" +async@^3.2.3: + version "3.2.4" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" + integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== + babel-jest@^29.3.1: version "29.3.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.3.1.tgz#05c83e0d128cd48c453eea851482a38782249f44" @@ -1870,6 +1875,15 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== +clang-format@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/clang-format/-/clang-format-1.8.0.tgz#7779df1c5ce1bc8aac1b0b02b4e479191ef21d46" + integrity sha512-pK8gzfu55/lHzIpQ1givIbWfn3eXnU7SfxqIwVgnn5jEM6j4ZJYjpFqFs4iSBPNedzRMmfjYjuQhu657WAXHXw== + dependencies: + async "^3.2.3" + glob "^7.0.0" + resolve "^1.1.6" + cli-table3@^0.6.0: version "0.6.3" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" @@ -2506,7 +2520,7 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" -glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -3798,7 +3812,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0: +resolve@^1.1.6, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== -- 2.50.1.windows.1 From f8067420d63c5952a2aa0201430b22b6916e92dd Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 23:17:51 -0800 Subject: [PATCH 43/47] Windows fixes --- .github/actions/setup-android/action.yml | 6 +++--- .github/actions/setup-js/action.yml | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index c2666453..ce3d1b23 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -3,11 +3,11 @@ name: Setup Android envirionment runs: using: "composite" steps: - - name: Install JDK 1.8 - uses: actions/setup-java@v1 + - name: Select Java Version + uses: actions/setup-java@v2 with: java-version: 1.8 - name: Install NDK 21 shell: bash - run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} + run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.3.6528147" diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml index 17ce83ed..3694fb17 100644 --- a/.github/actions/setup-js/action.yml +++ b/.github/actions/setup-js/action.yml @@ -11,10 +11,16 @@ runs: - name: Install emsdk uses: ./.github/actions/install-emsdk - - name: Install ninja + - name: Install ninja (Linux) + if: ${{ runner.os == 'Linux' }} shell: bash run: sudo apt-get install -y ninja-build + - name: Install ninja (Windows) + if: ${{ runner.os == 'Windows' }} + shell: powershell + run: choco install ninja + - name: yarn install shell: bash run: yarn install --frozen-lockfile -- 2.50.1.windows.1 From eff8774fcbd793f2268329b20031bc26facea85e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 23:22:15 -0800 Subject: [PATCH 44/47] Fix actions/setup-java@v2 --- .github/actions/setup-android/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index ce3d1b23..4aad9f80 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -6,7 +6,8 @@ runs: - name: Select Java Version uses: actions/setup-java@v2 with: - java-version: 1.8 + distribution: temurin + java-version: 8 - name: Install NDK 21 shell: bash -- 2.50.1.windows.1 From 2c525df0c0ffdcbf71b7774f6d2b6ea0fc876352 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 23:24:22 -0800 Subject: [PATCH 45/47] Remove explicit NDK install --- .github/actions/setup-android/action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index 4aad9f80..39bbbcee 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -8,7 +8,3 @@ runs: with: distribution: temurin java-version: 8 - - - name: Install NDK 21 - shell: bash - run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.3.6528147" -- 2.50.1.windows.1 From ae0e80f2f52c2c5cb95095b4e60c81621ce19829 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 23:29:36 -0800 Subject: [PATCH 46/47] Show OS before mode --- .github/workflows/validate-android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-android.yml b/.github/workflows/validate-android.yml index d0c7081d..3da04e98 100644 --- a/.github/workflows/validate-android.yml +++ b/.github/workflows/validate-android.yml @@ -9,7 +9,7 @@ on: jobs: build: - name: Build [${{ matrix.mode }}][${{ matrix.os }}] + name: Build [${{ matrix.os }}][${{ matrix.mode }}] runs-on: ${{ matrix.os }} strategy: matrix: -- 2.50.1.windows.1 From 49660865b2d2dc2bee537a4a1884d65472f68cba Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sat, 24 Dec 2022 23:55:25 -0800 Subject: [PATCH 47/47] set via BASHOPTS --- .github/actions/clang-format/action.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 8d9a57a3..b81af54f 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -18,7 +18,6 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: | - shopt -s extglob - shopt -s nullglob - clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm} + env: + BASHOPTS: extglob:nullglob + run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm} -- 2.50.1.windows.1