forked from jsmapr1/simplifying-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscope.spec.js
More file actions
37 lines (33 loc) · 827 Bytes
/
Copy pathscope.spec.js
File metadata and controls
37 lines (33 loc) · 827 Bytes
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
31
32
33
34
35
36
37
import expect from 'expect';
import { addClick } from './problem';
import { addClick as addClickCurry } from './curry';
import { addClick as addClickLet } from './scope';
describe('let scope', () => {
it('should have a scope problem', () => {
const items = [
{},
{},
];
addClick(items);
expect(items[0].onClick()).toEqual(2);
expect(items[1].onClick()).toEqual(2);
});
it('should not have a problem', () => {
const items = [
{},
{},
];
addClickCurry(items);
expect(items[0].onClick()).toEqual(0);
expect(items[1].onClick()).toEqual(1);
});
it('should not have a problem', () => {
const items = [
{},
{},
];
addClickLet(items);
expect(items[0].onClick()).toEqual(0);
expect(items[1].onClick()).toEqual(1);
});
});