How to use the fbt.IntlVariations.BITMASK_GENDER function in fbt

To help you get started, we’ve selected a few fbt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / fbt_v0.x.x / flow_v0.69.x- / test_fbt.js View on Github external
it('should raise an error when call `.name()` with invalid argument', () => {
    // $ExpectError: first argument must be a string
    fbt.name(1, IntlVariations.GENDER_FEMALE);

    // $ExpectError: `BITMASK_GENDER` is missing in enum
    fbt.name('test', IntlVariations.BITMASK_GENDER);
  });
});
github flow-typed / flow-typed / definitions / npm / fbt_v0.x.x / flow_v0.69.x- / test_fbt.js View on Github external
it('should raise an error when call `.param()` with invalid argument', () => {
    // $ExpectError: first argument must be a string
    fbt.param(12, 18);
    // $ExpectError: third argument must be an object
    fbt.param('age', 18, 11);
    // $ExpectError: `abcd` is missing
    fbt.param('age', 18, { abcd: true });
    // $ExpectError
    fbt.param('age', 18, { number: 'need numeber' });

    // $ExpectError: BITMASK_GENDER is missing in enum
    fbt.param('age', 18, { gender: IntlVariations.BITMASK_GENDER });
  });
});