summaryrefslogtreecommitdiff
path: root/src/use-sunlight.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/use-sunlight.test.js')
-rw-r--r--src/use-sunlight.test.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/use-sunlight.test.js b/src/use-sunlight.test.js
new file mode 100644
index 0000000..a4f4719
--- /dev/null
+++ b/src/use-sunlight.test.js
@@ -0,0 +1,10 @@
+import { computeLightLevel } from './use-sunlight'
+
+// Test the calculations used in the hook.
+// Not sure if it's worth testing the public hook
+// API
+test('computeLightLevel', () => {
+ expect(
+ computeLightLevel({ latitude: 0, longitude: 0, loading: false })
+ ).toMatchSnapshot()
+})