Unit testing Connections.ts (#66)

* Jest, Enzyme test env setup

* unit tests for telemetry state update logic

* remove sinon, superfluous scripts

* Remove console log
This commit is contained in:
YJ
2018-10-05 00:14:53 -07:00
committed by Maciej Hirsz
parent b8ad6249ca
commit 8e16f7c129
7 changed files with 1279 additions and 86 deletions
+5 -1
View File
@@ -12,7 +12,11 @@ export class Persistent<Data> {
const stored = window.localStorage.getItem(key) as Maybe<Stringified<Data>>;
if (stored) {
this.value = parse(stored);
try {
this.value = parse(stored);
} catch (err) {
this.value = initial;
}
} else {
this.value = initial;
}