From 103ea872d222417a85c553bc321ed18b304181c8 Mon Sep 17 00:00:00 2001 From: sly Date: Sat, 31 Oct 2020 12:08:47 -0700 Subject: [PATCH] Add: new tests for Decorators.js --- test/tests/decorators.js | 20 ++++++++++++++++++++ test/tests/index.js | 1 + 2 files changed, 21 insertions(+) create mode 100644 test/tests/decorators.js diff --git a/test/tests/decorators.js b/test/tests/decorators.js new file mode 100644 index 00000000..05fa24c5 --- /dev/null +++ b/test/tests/decorators.js @@ -0,0 +1,20 @@ +/* @flow */ + +import { memoized, promise } from '../../src/decorators'; + +describe('Decorators test', () => { + it('Should return an object with a value', () => { + const result = {}; + memoized({}, 'test', result); + if (!result.value) { + throw new Error(`Expected result to have a value`); + } + }); + it('Should return an object with a value', () => { + const result = { value: '' }; + promise({}, 'test', result); + if (!result.value) { + throw new Error(`Expected result to have a value`); + } + }); +}); diff --git a/test/tests/index.js b/test/tests/index.js index ec8e7b1f..64745aea 100644 --- a/test/tests/index.js +++ b/test/tests/index.js @@ -6,3 +6,4 @@ import './css'; import './experiment'; import './global'; import './device'; +import './decorators';