1 | "use strict";
|
2 |
|
3 | var _asyncOperations = require("./async-operations");
|
4 |
|
5 | test('setAsyncOperation', function () {
|
6 | expect((0, _asyncOperations.setAsyncOperation)({}, 'a')).toEqual({
|
7 | a: true
|
8 | });
|
9 | expect((0, _asyncOperations.setAsyncOperation)({}, 'a', 'custom')).toEqual({
|
10 | a: 'custom'
|
11 | });
|
12 | });
|
13 | test('delAsyncOperation', function () {
|
14 | var asyncState = {
|
15 | foo: 'foo',
|
16 | bar: 'bar'
|
17 | };
|
18 | expect((0, _asyncOperations.delAsyncOperation)(asyncState, 'foo')).toEqual({
|
19 | bar: 'bar'
|
20 | });
|
21 | });
|
22 | test('clearAsyncOperation', function () {
|
23 | var asyncState = {
|
24 | foo: 'foo',
|
25 | bar: 'bar'
|
26 | };
|
27 | expect((0, _asyncOperations.clearAsyncOperation)(asyncState)).toEqual({});
|
28 | expect((0, _asyncOperations.clearAsyncOperation)(asyncState, 'foo')).toEqual({
|
29 | foo: 'foo'
|
30 | });
|
31 | }); |
\ | No newline at end of file |