Add data-disabled to test fixtures (#1286)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1286

This can be marked in fixtures to skip a test without commenting it out. We add one more usage of this.

The same functionality existed (unused) before for `experiments`, which I changed to `data-experiments`.

Formatting of JS tests changed to be closer to what Prettier would output, and to remove usage of `Yoga.UNDEFINED` which doesn't existi and just resolves to `undefined` (this is converted to NaN by the wrapper layer).

Reviewed By: yungsters

Differential Revision: D45723003

fbshipit-source-id: fedd16a248b8fe2541ab500731b58f4b01129339
This commit is contained in:
Nick Gerleman
2023-05-10 21:08:50 -07:00
committed by Facebook GitHub Bot
parent e409bfb43a
commit eddb13efaf
52 changed files with 1846 additions and 1101 deletions

View File

@@ -34,10 +34,15 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
]);
}},
emitTestPrologue:{value:function(name, experiments) {
emitTestPrologue:{value:function(name, experiments, disabled) {
this.push('TEST(YogaTest, ' + name + ') {');
this.pushIndent();
if (disabled) {
this.push('GTEST_SKIP();');
this.push('');
}
this.push('const YGConfigRef config = YGConfigNew();')
for (var i in experiments) {
this.push('YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeature' + experiments[i] +', true);');