react-native-navigation的迁移库

env.test.js 823B

12345678910111213141516171819202122232425262728293031
  1. const eq = require('lodash/eq');
  2. const isEqual = require('lodash/isEqual');
  3. describe('testing that the environment is working properly', () => {
  4. it('object spread', () => {
  5. const { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
  6. expect(x).toEqual(1);
  7. expect(y).toEqual(2);
  8. expect(z).toEqual({ a: 3, b: 4 });
  9. });
  10. it('async await', async () => {
  11. const result = await new Promise((r) => r('hello'));
  12. expect(result).toEqual('hello');
  13. });
  14. it('equality tests', () => {
  15. expect(eq('hello', 'hello')).toBe(true);
  16. expect(isEqual('hello', 'hello')).toBe(true);
  17. expect(eq('hello', Object('hello'))).toBe(false);
  18. expect(isEqual('hello', Object('hello'))).toBe(true);
  19. const a = {};
  20. const b = {};
  21. expect(eq(a, b)).toBe(false);
  22. expect(isEqual(a, b)).toBe(true);
  23. });
  24. });