From 2c67546ad15b0c54d5588f4baeb96b8f2e25155b Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 9 Oct 2018 03:51:28 -0700 Subject: [PATCH] Add test for pluginStates Summary: It's not super useful, to be honest, but it's to have one open source `.node.js` test in place so `yarn test` doesn't error out. Reviewed By: danielbuechele Differential Revision: D10217530 fbshipit-source-id: c0e17e48782174b856ef6d5fe94c5c042564e4f5 --- src/reducers/__tests__/pluginStates.node.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/reducers/__tests__/pluginStates.node.js diff --git a/src/reducers/__tests__/pluginStates.node.js b/src/reducers/__tests__/pluginStates.node.js new file mode 100644 index 000000000..e7ab88fd5 --- /dev/null +++ b/src/reducers/__tests__/pluginStates.node.js @@ -0,0 +1,16 @@ +/** + * Copyright 2018-present Facebook. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * @format + */ + +import {default as reducer, setPluginState} from '../pluginStates'; + +test('reduce setPluginState', () => { + const res = reducer( + {}, + setPluginState({pluginKey: 'myPlugin', state: {a: 1}}), + ); + expect(res).toEqual({myPlugin: {a: 1}}); +});