forked from wix/react-native-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.test.js
30 lines (24 loc) · 823 Bytes
/
env.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const eq = require('lodash/eq');
const isEqual = require('lodash/isEqual');
describe('testing that the environment is working properly', () => {
it('object spread', () => {
const { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
expect(x).toEqual(1);
expect(y).toEqual(2);
expect(z).toEqual({ a: 3, b: 4 });
});
it('async await', async () => {
const result = await new Promise((r) => r('hello'));
expect(result).toEqual('hello');
});
it('equality tests', () => {
expect(eq('hello', 'hello')).toBe(true);
expect(isEqual('hello', 'hello')).toBe(true);
expect(eq('hello', Object('hello'))).toBe(false);
expect(isEqual('hello', Object('hello'))).toBe(true);
const a = {};
const b = {};
expect(eq(a, b)).toBe(false);
expect(isEqual(a, b)).toBe(true);
});
});