react-native-navigation的迁移库

env.test.js 778B

1234567891011121314151617181920212223242526272829
  1. import * as _ from 'lodash';
  2. describe('test environment', () => {
  3. it('handles object spread', () => {
  4. const { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
  5. expect(x).toEqual(1);
  6. expect(y).toEqual(2);
  7. expect(z).toEqual({ a: 3, b: 4 });
  8. });
  9. it('handles async await', async () => {
  10. const result = await new Promise((r) => r('hello'));
  11. expect(result).toEqual('hello');
  12. });
  13. it('lodash equality tests', () => {
  14. expect(_.eq('hello', 'hello')).toBe(true);
  15. expect(_.isEqual('hello', 'hello')).toBe(true);
  16. expect(_.eq('hello', Object('hello'))).toBe(false);
  17. expect(_.isEqual('hello', Object('hello'))).toBe(true);
  18. const a = {};
  19. const b = {};
  20. expect(_.eq(a, b)).toBe(false);
  21. expect(_.isEqual(a, b)).toBe(true);
  22. });
  23. });