Files
yoga/javascript/jest.setup.ts
Nick Gerleman 4c5c647f41 Move generated Jest tests to TypeScript (#1287)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1287

Outputs tests as TypeScript, along with using/testing the new form of enums imported directly from the package.

We need to change how we are telling Jest which variant to run, so that tests can import enums from "yoga-layout" and have it resolve to the entrypoint which has a binary which has already been built.

Reviewed By: yungsters

Differential Revision: D45723545

fbshipit-source-id: 63e6da1fdf7b4b13ccc97fa95d9dee87b4d3605d
2023-05-10 21:11:22 -07:00

18 lines
434 B
TypeScript

/**
* 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 () => {
const {loadYoga, default: Yoga} = require('yoga-layout');
globalThis.Yoga = Yoga ?? (await loadYoga());
};
Object.defineProperty(globalThis, 'YGBENCHMARK', {
get: () => globalThis.test,
});