index.test.ts 475 B

1234567891011121314151617
  1. import test from 'ava';
  2. import { getInfo } from '../src/index.js';
  3. if (__BROWSER__) {
  4. test('it returns browser info', t => {
  5. t.is(getInfo(), 'Platform: browser, Version: 0.20.0');
  6. });
  7. } else if (__REACTNATIVE__) {
  8. test('it returns react native info', t => {
  9. t.is(getInfo(), 'Platform: react-native, Version: 0.20.0');
  10. });
  11. } else {
  12. test('it returns node info', t => {
  13. t.is(getInfo(), 'Platform: node, Version: 0.20.0');
  14. });
  15. }