summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2019-04-06 18:40:05 -0700
committerNick Van Doorn <vandoorn.nick@gmail.com>2019-04-06 18:40:05 -0700
commit6953f291b69ba551304a9fb7a965b97154cc8811 (patch)
tree4333fb561bada410658a65364fe63976905bce49
parent34e8f44946f95eba8a9fcc26b29c70794d915dc9 (diff)
Test for middleware error
-rw-r--r--src/sunlight-theme.test.js15
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)
+ })
+})