setupTest.js   A
last analyzed

Size

Lines of Code 21

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
nc 4
dl 0
loc 21
rs 10
c 1
b 0
f 0
noi 0
1
window.cancelAnimationFrame = window.cancelAnimationFrame || function(){}
2
window.requestAnimationFrame = window.requestAnimationFrame || function(){}
3
class LocalStorageMock {
4
  constructor() {
5
    this.store = {};
6
  }
7
8
  clear() {
9
    this.store = {};
10
  }
11
12
  getItem(key) {
13
    return this.store[key];
14
  }
15
16
  setItem(key, value) {
17
    this.store[key] = value.toString();
18
  }
19
};
20
21
global.localStorage = new LocalStorageMock;
22