diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-04-06 18:40:05 -0700 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2019-04-06 18:40:05 -0700 |
commit | 6953f291b69ba551304a9fb7a965b97154cc8811 (patch) | |
tree | 4333fb561bada410658a65364fe63976905bce49 | |
parent | 34e8f44946f95eba8a9fcc26b29c70794d915dc9 (diff) |
Test for middleware error
-rw-r--r-- | src/sunlight-theme.test.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sunlight-theme.test.js b/src/sunlight-theme.test.js new file mode 100644 index 0000000..da207db --- /dev/null +++ b/src/sunlight-theme.test.js @@ -0,0 +1,15 @@ +import { SunlightTheme } from './sunlight-theme' +import { render } from 'react-testing-library' +import React from 'react' + +global.navigator.geolocation = { + getCurrentPosition: jest.fn(), + watchPosition: jest.fn() +} + +describe('SunlightTheme', () => { + test('Invalid middleware', () => { + const r = () => render(<SunlightTheme middleware={[5, 'yo']} />) + expect(r).toThrow(Error) + }) +}) |