From 2db86bad753cf970e4ea94a4e7e3b1ae56b56ddc Mon Sep 17 00:00:00 2001 From: Nate Hunzaker Date: Fri, 27 Mar 2015 09:58:39 -0400 Subject: [PATCH] [add] Test coverage for new options passing --- src/__tests__/Microcosm-test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/__tests__/Microcosm-test.js b/src/__tests__/Microcosm-test.js index fe92aa76..a4c228c4 100644 --- a/src/__tests__/Microcosm-test.js +++ b/src/__tests__/Microcosm-test.js @@ -141,4 +141,16 @@ describe('Microcosm', function() { m.deserialize() }) + it ('passes the options argument from the constructor to getInitialState', function() { + class MyApp extends Microcosm { + getInitialState(options) { + return options + } + } + + let app = new MyApp('test') + + app._state.should.equal('test') + }) + })